Snippets Collections
let fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;
<key>com.apple.private.tcc.allow</key>
<array>
    <string>kTCCServiceReminders</string>
    <string>kTCCServiceCalendar</string>
    <string>kTCCServiceAddressBook</string>
</array>
$ curl -Ls https://github.com/minuscorp/Tunisia/releases/download/latest/tunisia.macos.zip -o /tmp/tunisia.macos.zip
$ unzip -j -d /usr/local/bin /tmp/tunisia.macos.zip 
/usr/local/bin/dwebp -o "${1%%.*}.PNG" $1
userTempDir=`/usr/bin/getconf DARWIN_USER_CACHE_DIR`
rm -fr $userTempDir*
sudo fs_usage -f pathname Google\ Chrome
sudo fs_usage -f pathname firefox-bin
脚注标记代码:

<sup><a id="footnote-1-backlink" href="chapter02.html#footnote-1">【1】</a></sup>
这里使用了上标文本标签 <sup> ... </sup> 以便于和正文文字区分。注意标签 <a> ... </a> 中有两个属性,id 是脚注标记的锚点,方便从脚注内容的位置跳转过来,href 的值表示的是从脚注标记转向脚注内容锚点所在的位置,注意路径、文件名以及脚注内容的 id 要和脚注内容相对应。

脚注内容代码:

<p><a id="footnote-1" href="chapter01.html#footnote-1-backlink">【1】</a>这里是注释内容。</p>
cd /private/var/folders
for i in *; do if [ "$i" != "zz" ]; then sudo rm -rf "$i"; fi; done
sudo rm -rf zz/*

var images = $('.faso-blogfront-section-image-container');
var excerpts = $('.faso-blogfront-data-entry-text');

for(var i = 0; i < images.length; i++){
  $(excerpts[i]).appendTo($(images[i]));
}
body, html {
    height: 100%;
    margin: 0;
}

.hero-image {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('https://unsplash.it/1800/1600');
    height: 50%;
    background-position: center;
    background-repeat: no-repeat;
    background-size:cover;
    position: relative;
}

.hero-text {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%,-50%);
    color: #fff;
}

.hero-button {
    width: 150px;
    height: 50px;
    font-size: 30px;
    font-weight: bold;
    background-color:tomato;
    border-radius:30% 10% 30%;
    border:none;
    outline:none;
    cursor: pointer;
    text-align: center;
    display: inline-block;
}

.hero-button:hover {
    background-color:red;
    color: #fff
}
$(document).ready(function() {
    $('<a href="/home/faso/commerce/settings?back=%2FcfgEditAccountPreferences.asp">Select website currency</a>').appendTo("table.cp_body_inner>tbody tr:eq(4)>td.cp_fielddata");
});
/***** Allow SVG *****/
//===================
add_filter( 'wp_check_filetype_and_ext', function($data, $file, $filename, $mimes) {

  global $wp_version;
  if ( $wp_version !== '4.7.1' ) {
     return $data;
  }

  $filetype = wp_check_filetype( $filename, $mimes );

  return [
      'ext'             => $filetype['ext'],
      'type'            => $filetype['type'],
      'proper_filename' => $data['proper_filename']
  ];

}, 10, 4 );

function cc_mime_types( $mimes ){
  $mimes['svg'] = 'image/svg+xml';
  return $mimes;
}
add_filter( 'upload_mimes', 'cc_mime_types' );

function fix_svg() {
  echo '<style type="text/css">
        .attachment-266x266, .thumbnail img {
             width: 100% !important;
             height: auto !important;
        }
        </style>';
}
add_action( 'admin_head', 'fix_svg' );
/***** Shorten Post/Page link  *****/
//============================
add_filter( 'get_shortlink', function ( $shortlink ) {
    return $shortlink;
});
// disable gutenberg  for posts
//========================
add_filter('use_block_editor_for_post', '__return_false', 10);

// disable gutenberg  for post types
//===========================
add_filter('use_block_editor_for_post_type', '__return_false', 10);
// Set WooCommerce Virtual Order Status to Complete After Payment
add_filter( 'woocommerce_payment_complete_order_status', 'virtual_order_payment_complete_order_status', 10, 2 );
function virtual_order_payment_complete_order_status( $order_status, $order_id ) {
  $order = new WC_Order( $order_id );
  if ( 'processing' == $order_status &&
       ( 'on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status ) ) {
    $virtual_order = null;
    if ( count( $order->get_items() ) > 0 ) {
      foreach( $order->get_items() as $item ) {
        if ( 'line_item' == $item['type'] ) {
          $_product = $order->get_product_from_item( $item );
          if ( ! $_product->is_virtual() ) {
            // once we've found one non-virtual product we know we're done, break out of the loop
            $virtual_order = false;
            break;
          } else {
            $virtual_order = true;
          }
        }
      }
    }
    // virtual order, mark as completed
    if ( $virtual_order ) {
      return 'completed';
    }
  }
  // non-virtual order, return original status
  return $order_status;
}
add_filter( 'woocommerce_default_address_fields' , 'custom_override_postcode_validation' );
 
function custom_override_postcode_validation( $address_fields ) {
  $address_fields['postcode']['required'] = false;
  return $address_fields;
}
function search_by_sku( $search, &$query_vars ) {
    global $wpdb;
    if(isset($query_vars->query['s']) && !empty($query_vars->query['s'])){
        $args = array(
            'posts_per_page'  => -1,
            'post_type'       => 'product',
            'meta_query' => array(
                array(
                    'key' => '_sku',
                    'value' => $query_vars->query['s'],
                    'compare' => 'LIKE'
                )
            )
        );
        $posts = get_posts($args);
        if(empty($posts)) return $search;
        $get_post_ids = array();
        foreach($posts as $post){
            $get_post_ids[] = $post->ID;
        }
        if(sizeof( $get_post_ids ) > 0 ) {
                $search = str_replace( 'AND (((', "AND ((({$wpdb->posts}.ID IN (" . implode( ',', $get_post_ids ) . ")) OR (", $search);
        }
    }
    return $search;
    
}
    add_filter( 'posts_search', 'search_by_sku', 999, 2 );
add_filter( 'woocommerce_default_address_fields' , 'QuadLayers_optional_postcode_checkout' );
function QuadLayers_optional_postcode_checkout( $p_fields ) {
$p_fields['postcode']['required'] = false;
return $p_fields;
}
// Disable support for comments and trackbacks in post types
function sv_disable_comments_post_types_support() {
	$post_types = get_post_types();
	foreach ($post_types as $post_type) {
		if(post_type_supports($post_type, 'comments')) {
			remove_post_type_support($post_type, 'comments');
			remove_post_type_support($post_type, 'trackbacks');
		}
	}
}
add_action('admin_init', 'sv_disable_comments_post_types_support');



// Close comments on the front-end
function sv_disable_comments_status() {
	return false;
}
add_filter('comments_open', 'sv_disable_comments_status', 20, 2);
add_filter('pings_open', 'sv_disable_comments_status', 20, 2);



// Hide existing comments
function sv_disable_comments_hide_existing_comments($comments) {
	$comments = array();
	return $comments;
}
add_filter('comments_array', 'sv_disable_comments_hide_existing_comments', 10, 2);



// Remove comments page in menu
function sv_disable_comments_admin_menu() {
	remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'sv_disable_comments_admin_menu');



// Redirect any user trying to access comments page
function sv_disable_comments_admin_menu_redirect() {
	global $pagenow;
	if ($pagenow === 'edit-comments.php') {
		wp_redirect(admin_url()); exit;
	}
}
add_action('admin_init', 'sv_disable_comments_admin_menu_redirect');



// Remove comments metabox from dashboard
function sv_disable_comments_dashboard() {
	remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal');
}
add_action('admin_init', 'sv_disable_comments_dashboard');



// Remove comments links from admin bar
function sv_disable_comments_admin_bar() {
	if (is_admin_bar_showing()) {
		remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60);
	}
}
add_action('init', 'sv_disable_comments_admin_bar');
// Automatically set the image Title, Alt-Text, Caption & Description upon upload
add_action( 'add_attachment', 'my_set_image_meta_upon_image_upload' );
function my_set_image_meta_upon_image_upload( $post_ID ) {
 
    // Check if uploaded file is an image, else do nothing
 
    if ( wp_attachment_is_image( $post_ID ) ) {
 
        $my_image_title = get_post( $post_ID )->post_title;
 
        // Sanitize the title:  remove hyphens, underscores & extra spaces:
        $my_image_title = preg_replace( '%\s*[-_\s]+\s*%', ' ',  $my_image_title );
 
        // Sanitize the title:  capitalize first letter of every word (other letters lower case):
        $my_image_title = ucwords( strtolower( $my_image_title ) );
 
        // Create an array with the image meta (Title, Caption, Description) to be updated
        // Note:  comment out the Excerpt/Caption or Content/Description lines if not needed
        $my_image_meta = array(
            'ID'        => $post_ID,            // Specify the image (ID) to be updated
            'post_title'    => $my_image_title,     // Set image Title to sanitized title
            'post_excerpt'  => $my_image_title,     // Set image Caption (Excerpt) to sanitized title
            'post_content'  => $my_image_title,     // Set image Description (Content) to sanitized title
        );
 
        // Set the image Alt-Text
        update_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );
 
        // Set the image meta (e.g. Title, Excerpt, Content)
        wp_update_post( $my_image_meta );
 
    } 
}
//// Validate if Email field is spam
add_action( 'elementor_pro/forms/validation/email', function( $field, $record, $ajax_handler ) {
    // Looking if email found in spam array, you can add to the array
  $spamemails = array("ericjonesonline@outlook.com", "eric@talkwithwebvisitor.com");
    if ( in_array( $field['value'] , $spamemails) ) {
        $ajax_handler->add_error( $field['id'], 'אנחנו לא אוהבים ספאם, נסו מייל אחר' );
    }
}, 10, 3 );
[
   {
      "mostrar":"in,out",
      "label":"CPR",
      "campo":"cpr",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo de CPR",
      "campo":"tipodecpr",
      "tipo":"select_valor",
      "colunas_in":"12",
      "colunas_out":"12",
      "requerido":"1",
      "opcoes":[
         "Física",
         "Financeira"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número da CPR",
      "campo":"numero_cpr",
      "tipo":"text",
      "requerido":"1",
      "colunas_in":"12",
      "colunas_out":"12",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Data de Emissão",
      "campo":"dataa",
      "tipo":"data",
      "colunas_in":"6",
      "colunas_out":"6",
      "requerido":"1",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Data de Vencimento",
      "campo":"datavenc",
      "tipo":"data",
      "colunas_in":"6",
      "colunas_out":"6",
      "requerido":"1",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo de Garantia 1",
      "campo":"tipogarantia01",
      "tipo":"select_valor",
      "colunas_in":"6",
      "requerido":"1",
      "colunas_out":"6",
      "opcoes":[
         "1. Sem Garantia",
         "2. Aval",
         "3. Penhor",
         "4. Hipoteca",
         "5. Alienação Fiduciária de Bens Móveis",
         "6. Alienação Fiduciária de Imóveis",
         "7. Patrimônio Rural em Afetação",
         "8. Cessão Fiduciária",
         "9. Seguro",
         "10. Outra"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo de Garantia 2",
      "campo":"tipogarantia02",
      "tipo":"select_valor",
      "colunas_in":"6",
      "colunas_out":"6",
      "opcoes":[
         "1. Sem Garantia",
         "2. Aval",
         "3. Penhor",
         "4. Hipoteca",
         "5. Alienação Fiduciária de Bens Móveis",
         "6. Alienação Fiduciária de Imóveis",
         "7. Patrimônio Rural em Afetação",
         "8. Cessão Fiduciária",
         "9. Seguro",
         "10. Outra"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo de Garantia 3",
      "campo":"tipogarantia03",
      "tipo":"select_valor",
      "colunas_in":"6",
      "colunas_out":"6",
      "opcoes":[
         "1. Sem Garantia",
         "2. Aval",
         "3. Penhor",
         "4. Hipoteca",
         "5. Alienação Fiduciária de Bens Móveis",
         "6. Alienação Fiduciária de Imóveis",
         "7. Patrimônio Rural em Afetação",
         "8. Cessão Fiduciária",
         "9. Seguro",
         "10. Outra"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo de Garantia 4",
      "campo":"tipogarantia04",
      "tipo":"select_valor",
      "colunas_in":"6",
      "colunas_out":"6",
      "opcoes":[
         "1. Sem Garantia",
         "2. Aval",
         "3. Penhor",
         "4. Hipoteca",
         "5. Alienação Fiduciária de Bens Móveis",
         "6. Alienação Fiduciária de Imóveis",
         "7. Patrimônio Rural em Afetação",
         "8. Cessão Fiduciária",
         "9. Seguro",
         "10. Outra"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Valor total da emissão",
      "campo":"valoremissao",
      "tipo":"decimal",
      "decimal_places":"2",
      "colunas_in":"6",
      "colunas_out":"6",
      "requerido":"1",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"PRODUTO",
      "campo":"produto",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Produto",
      "campo":"produtosele",
      "tipo":"select_valor",
      "colunas_in":"6",
      "colunas_out":"12",
      "opcoes":[
         "SOJA",
         "MILHO",
         "TRIGO",
         "MANDIOCA"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Safra",
      "campo":"safra",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"4",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Quantidade",
      "campo":"qtde",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"4",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"EMITENTE",
      "campo":"emitente_digital",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Nome",
      "campo":"nome_digital",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "requerido":"1",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município",
      "campo":"municipioemitente",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado",
      "campo":"estadoemitente",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua",
      "campo":"ruaemitente",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número",
      "campo":"numeroemitente",
      "tipo":"text",
      "colunas_in":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP",
      "campo":"cepdoemitente",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento",
      "campo":"complemento",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail",
      "campo":"e-mail",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Telefone fixo",
      "campo":"telfixoemi",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "placeholder":"(xx) xxxx-xxxx",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Telefone celular",
      "campo":"telcelularemitente",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "placeholder":"(xx) xxxxx-xxxx",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CNPJ",
      "campo":"cnpj",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Razão Social",
      "campo":"razao",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CPF",
      "campo":"cpff",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO INTERVENIENTE 1",
      "campo":"interveniente1",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo Interveniente 1",
      "campo":"tipo_inte1",
      "tipo":"select_valor",
      "colunas_in":"4",
      "colunas_out":"6",
      "aceita_recategorizar":"1",
      "opcoes":[
         "Avalista",
         "Anuente",
         "Garantidor"
      ]
   },
   {
      "mostrar":"in,out",
      "label":"Nome 1",
      "campo":"nome_interveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município 1",
      "campo":"municipiointerveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado 1",
      "campo":"estadoeinterveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua 1",
      "campo":"ruainterveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número 1",
      "campo":"numerointerveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP 1",
      "campo":"cepinterveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento 1",
      "campo":"complementointerveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail 1",
      "campo":"e-mailinterveniente1",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO INTERVENIENTE 2",
      "campo":"interveniente2",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo Interveniente 2",
      "campo":"tipo_inte2",
      "tipo":"select_valor",
      "colunas_in":"4",
      "colunas_out":"6",
      "opcoes":[
         "Avalista",
         "Anuente",
         "Garantidor"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Nome 2",
      "campo":"nome_interveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município 2",
      "campo":"municipiointerveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado 2",
      "campo":"estadoeinterveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua 2",
      "campo":"ruainterveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número 2",
      "campo":"numerointerveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP 2",
      "campo":"cepinterveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento 2",
      "campo":"complementointerveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail 2",
      "campo":"e-mailinterveniente2",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO INTERVENIENTE 3",
      "campo":"interveniente3",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo Interveniente 3",
      "campo":"tipo_inte3",
      "tipo":"select_valor",
      "colunas_in":"4",
      "colunas_out":"6",
      "aceita_recategorizar":"1",
      "opcoes":[
         "Avalista",
         "Anuente",
         "Garantidor"
      ]
   },
   {
      "mostrar":"in,out",
      "label":"Nome 3",
      "campo":"nome_interveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município 3",
      "campo":"municipiointerveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado 3",
      "campo":"estadoeinterveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua 3",
      "campo":"ruainterveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número 3",
      "campo":"numerointerveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP 3",
      "campo":"cepinterveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento 3",
      "campo":"complementointerveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail 3",
      "campo":"e-mailinterveniente3",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO INTERVENIENTE 4",
      "campo":"interveniente4",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo Interveniente 4",
      "campo":"tipo_inte4",
      "tipo":"select_valor",
      "colunas_in":"4",
      "colunas_out":"6",
      "aceita_recategorizar":"1",
      "opcoes":[
         "Avalista",
         "Anuente",
         "Garantidor"
      ]
   },
   {
      "mostrar":"in,out",
      "label":"Nome 4",
      "campo":"nome_interveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município 4",
      "campo":"municipiointerveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado 4",
      "campo":"estadoeinterveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua 4",
      "campo":"ruainterveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número 4",
      "campo":"numerointerveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP 4",
      "campo":"cepinterveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento 4",
      "campo":"complementointerveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail 4",
      "campo":"e-mailinterveniente4",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO INTERVENIENTE 5",
      "campo":"interveniente5",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Tipo Interveniente 5",
      "campo":"tipo_inte5",
      "tipo":"select_valor",
      "colunas_in":"4",
      "colunas_out":"6",
      "opcoes":[
         "Avalista",
         "Anuente",
         "Garantidor"
      ],
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Nome 5",
      "campo":"nome_interveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município 5",
      "campo":"municipiointerveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado 5",
      "campo":"estadoeinterveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Rua 5",
      "campo":"ruainterveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Número 5",
      "campo":"numerointerveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CEP 5",
      "campo":"cepinterveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Complemento 5",
      "campo":"complementointerveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail 5",
      "campo":"e-mailinterveniente5",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"DADOS DO CONTADOR",
      "campo":"contador",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Nome do Contador",
      "campo":"nomecontador",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Endereço do Contador",
      "campo":"enderecocont",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Telefone do Contador",
      "campo":"telcontador",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail do Contador",
      "campo":"emailcontador",
      "tipo":"text",
      "colunas_in":"6",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CARTÓRIO 1",
      "campo":"cartorio1",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Nome cartório 1",
      "campo":"nomecartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Titular cartório 1",
      "campo":"titularcartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município cartório 1",
      "campo":"municipiocartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado cartório 1",
      "campo":"estadocartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Endereço cartório 1",
      "campo":"endcartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Telefone cartório 1",
      "campo":"telcartorio",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail cartório 1",
      "campo":"e-mailcart1",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"CARTÓRIO 2",
      "campo":"cartorio2",
      "tipo":"titulo6",
      "colunas_in":"12",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Nome cartório 2",
      "campo":"nomecartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Titular cartório 2",
      "campo":"titularcartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Município cartório 2",
      "campo":"municipiocartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Estado cartório 2",
      "campo":"estadocartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Endereço cartório 2",
      "campo":"endcartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Telefone cartório 2",
      "campo":"telcartorio2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"E-mail cartório 2",
      "campo":"e-mailcart2",
      "tipo":"text",
      "colunas_in":"12",
      "colunas_out":"6",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Faça o upload dos documentos marcados com * a seguir",
      "campo":"upload",
      "tipo":"titulo5",
      "colunas_in":"12",
      "colunas_out":"12",
      "aceita_recategorizar":"1"
   },
   {
      "mostrar":"in,out",
      "label":"Anexar CPR",
      "campo":"anexar_cpr",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar documento CPF do emitente",
      "campo":"anexarcpf",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar documento Última Alteração do Contrato Social",
      "campo":"anexarcs",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar RG do Interveniente 1",
      "campo":"anexarrg1",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar CPF do Interveniente 1",
      "campo":"anexarcpfi1",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Certidão de Casamento do Interveniente 1 (se houver)",
      "campo":"anexarcerti1",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 1 - A",
      "campo":"anexardoci1",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 1 - B",
      "campo":"anexardocbi1",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar RG do Interveniente 2",
      "campo":"anexarrg2",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar CPF do Interveniente 2",
      "campo":"anexarcpfi2",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Certidão de Casamento do Interveniente 2 (se houver)",
      "campo":"anexarcerti2",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 2 - A",
      "campo":"anexardoci2",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 2 - B",
      "campo":"anexardocbi2",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar RG do Interveniente 3",
      "campo":"anexarrg3",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar CPF do Interveniente 3",
      "campo":"anexarcpfi3",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Certidão de Casamento do Interveniente 3 (se houver)",
      "campo":"anexarcerti3",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 3 - A",
      "campo":"anexardoci3",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 3 - B",
      "campo":"anexardocbi3",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar RG do Interveniente 4",
      "campo":"anexarrg4",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar CPF do Interveniente 4",
      "campo":"anexarcpfi4",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Certidão de Casamento do Interveniente 4 (se houver)",
      "campo":"anexarcerti4",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 4 - A",
      "campo":"anexardoci4",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 4 - B",
      "campo":"anexardocbi4",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar RG do Interveniente 5",
      "campo":"anexarrg5",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar CPF do Interveniente 5",
      "campo":"anexarcpfi5",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Certidão de Casamento do Interveniente 5 (se houver)",
      "campo":"anexarcerti5",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 5 - A",
      "campo":"anexardoci5",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"*Anexar Documento Adicional Interveniente 5 - B",
      "campo":"anexardocbi5",
      "classe":"hide",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   },
   {
      "mostrar":"in,out",
      "label":"Outros documentos não obrigatórios também são permitidos",
      "campo":"outrodocs",
      "tipo":"titulo6",
      "colunas_in":"4",
      "colunas_out":"12"
   }
]
functpromise1 = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('foo');
  }, 300);
});

promise1.then((value) => {
  console.log(value);
  // expected output: "foo"
});

console.log(promise1);
// expected output: [object Promise]
number = 1_000_000.50
f"${number:,.0f}"
'$1,000,000'

f"${number:,.2f}"
'$1,000,000.50'
Cannot update while running on a read-only volume. The application is on a read-only volume. Please move the application and try again. If you're on macOS Sierra or later, you'll need to move the application out of the Downloads directory. See https://github.com/Squirrel/Squirrel.Mac/issues/182 for more information.
Update Error!

AppName  can’t be updated when it’s running from a read-only volume like a disk image or an optical drive. Move AppName to your Applications folder, relaunch it from there, and try again.
 sudo chown -R root "/Applications/Charles.app/Contents/Resources"
 sudo chmod -R u+s "/Applications/Charles.app/Contents/Resources"
-f                            Force rebuild extensions cache
-v                            Verbose booting shows debug information
-s                            Boots into single user mode (means only terminal based mode)
-x                            Boots into safe mode
-legacy                       Boots into 32bit instead of 64bit mode
rd=disk0s1                    Force to boot a specific partition on a specific drive (BSD drive notation, means disk0 = physical disk 1). Here disk1 partition 1 is forced to be booted.
Graphics Mode=1024x768x32@75  Forces to boot with a resolution of 1024 x 768 with 32bit colors at 75Hz
Kernel=mach_kernel            Forces to load a specific kernel, helpful for testing of new kernels.
cpus=1                        Force using only 1 CPU core, may help addressing issues
idlehalt=0                    May solve stuttering and shuttering on dualcore CPUs
platform=X86PC                Forces to not use powermanagement (disables ACPI)
platform=ACPI                 Forces to use powermanagement (enables ACPI, but may crash your system)
defaults write ./com.apple.speech.synthesis.general.prefs TimeAnnouncementPrefs -dict-add TimeAnnouncementsEnabled -bool YES
"""index.py
Usage:
  index.py serve <dir>
  index.py serve <dir> [--port=<port>]
  index.py info <dir>
  index.py (-h | --help)
  index.py --version
Options:
  -h --help     Show this screen.
  --version     Show version.
  --port=<port> Port to bind to [default: 8080].
"""
# -*- coding: utf-8 -*-

import os
import multiprocessing
import sys


import crayons
import delegator
from docopt import docopt
from flask import Flask, request, abort
from livereload import Server as ReloadServer
from whitenoise import WhiteNoise


def yield_files(dir, endswith):
    for root, dirs, files in os.walk(dir):

        # Cleanup root.
        root = root[len(dir) + 1:]

        # Exclude directories that start with a period.
        if not root.startswith('.'):
            for file in files:
                if file.endswith(endswith):
                    yield os.sep.join((root, file))


def do_info():
    """Runs the 'info' command, from the CLI."""
    pass


def convert_dir(dir):
    dir = os.path.abspath(dir)
    try:
        assert os.path.isdir(dir)
    except AssertionError:
        print(crayons.red('The directory given must be a valid one!'))
        sys.exit(1)

    return dir

def convert_port(port):
    if port is None:
        port = '8080'
    else:
        try:
            port = int(port)
        except ValueError:
            print(crayons.red('The port given must be a valid number!'))
            sys.exit(1)

    return port

def prepare_extras(request):
    extras = {}

    # 
    if request.json:
        extras.update(request.json)
    if request.form:    
        extras.update(request.form)
    
    if request.args:
        extras.update(request.args)

    extra = []

    for key, values in extras.items():
        for value in values:
            extra.append((key, value))
    
    return extra

def find(endswith, dir, path):
    found = None
    for fs_path in yield_files(dir, endswith):
        print '{0}{1}'.format(path, endswith) 
        print fs_path
        print
        if '{0}{1}'.format(path, endswith) in fs_path:
            return fs_path

def directory_listing(path):
    html = ''
    for i in os.listdir(path):
        html += '<li><a href="{0}">{0}</a></li>'.format(i)
    return html

def do_serve(dir, port):
    """Runs the 'serve' command, from the CLI."""

    # Convert dir and port to appropriate values.
    dir = convert_dir(dir)
    port = convert_port(port)

    os.chdir(dir)

    app = Flask(__name__)

    @app.route('/', defaults={'path': './'})
    @app.route('/<path:path>')
    def catch_all(path):

        # Support for index.html.
        found = find('index.html', dir, path)
        
        # Support for index.py
        if not found:
            found = find('index.py', dir, path)

        # Support for directory listing.
        if not found:
            found = find('.py', dir, path)
        

        # A wild script was found!
        if found:
            if '.py' in found:
                extras = prepare_extras(request)
            
                for key, value in extras:
                    os.environ[key] = value
                
                c = delegator.run('python {0}'.format(found))

                for key, value in extras:
                    del os.environ[key]

                return c.out

            elif '.html' in found:
                # Strip prepending slashes. 
                if found.startswith('/'):
                    found = found[1:]
                
                # Open the file, and spit out the contents. 
                with open(found) as html:
                    return html.read()

        else:
            if os.path.isdir(path):
                return directory_listing(path)

            abort(404)


    @app.before_request
    def before_request():
        app.add_files(dir, prefix='/')

    @app.after_request
    def after_request(response):
        response.headers['X-Powered-By'] = 'index.py by Kenneth Reitz'
        return response

    app = WhiteNoise(app, root=dir)
    server = ReloadServer(app)
    server.watch('{0}/**'.format(dir))

    # Alert the user.
    print(crayons.yellow('Serving up \'{0}\' on port {1}.'.format(dir, port)))
    server.serve(port=port)


def main():
    args = docopt(__doc__, version='index.py, version 0.0.0')

    if args['info']:
      do_info()

    if args['serve']:
      do_serve(dir=args['<dir>'], port=args['--port'])


if __name__ == '__main__':
    main()
defaults write com.pilotmoon.popclip UseShortTitles -bool YES
killall PopClip && open -a PopClip
install.packages("tidyverse")
curl -s https://raw.githubusercontent.com/dnote/doctor/master/install.sh | sh
//Totals By month, Brand vs. Category
with b as (select to_date(date_trunc('month',RECEIPT_PURCHASE_DATE)) as date,
    case when barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR') then 'Sentry'
           end as BRAND,
    panel_cont_15m,           
    receipt_id,
    user_id,
    sum(ITEM_DISCOUNTED_EXTENDED_PRICE) as sales,           
    sum(ITEM_QUANTITY) as units
from "DATAVERSE"."FETCH360"."TRANSACTION360_IRI"
where 1=1
    and user_active=true
    and receipt_purchase_date::date between '2019-04-01' and '2021-04-30'
   and barcode_manufacturer in ('SERGEANTS PET PRODUCTS')
    and barcode_category_2 in ('CALMING COLLAR')
 group by 1,2,3,4,5
),
c as (select to_date(date_trunc('month',RECEIPT_PURCHASE_DATE)) as date,
       case when barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR') then 'Sentry'
           end as BRAND,
      panel_cont_15m,
    barcode_manufacturer,
    receipt_id,
    user_id,  
    sum(ITEM_DISCOUNTED_EXTENDED_PRICE) as sales,
    sum(ITEM_QUANTITY) as units
from "DATAVERSE"."FETCH360"."TRANSACTION360_IRI"
where 1=1
    and user_active=true
    and receipt_purchase_date::date between '2019-04-01' and '2021-04-30'
     and barcode_category_2 in ('CALMING COLLAR')
   --    and barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR')
 group by 1,2,3,4,5,6
),
b_15mcp as (select *
from b
where panel_cont_15m=true                       
 --group by 1,2,3,4,5,6
),
c_15mcp as (select *
from c
where panel_cont_15m=true                         
-- group by 1,2,3,4,5,6,7
)
select distinct
    type, date, sales, trips, users, units
from
//BRAND ALL USERS
(select distinct 'BRAND - ALL USERS' as type,
    date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from b
 group by 1,2
union
--CATEGORY ALL USERS
 select distinct 'TOTAL CATEGORY - ALL USERS' as type, 
 date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c
 group by 1,2
union
-- BRAND 15MCP 
 select distinct 'BRAND - 15MCP' as type,   
 date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from b_15mcp
 group by 1,2
union
-- CATEGORY 15MCP
select distinct 'TOTAL CATEGORY - 15MCP' as type,
    date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c_15mcp
 group by 1,2
 union
--OTHER
 select distinct 'OTHER - ALL USERS' as type,
    date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c
 where barcode_manufacturer not in ('SERGEANTS PET PRODUCTS')
 group by 1,2
 union
select distinct 'OTHER - 15MCP' as type,
    date, sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c_15mcp
 where barcode_manufacturer not in ('SERGEANTS PET PRODUCTS')
 group by 1,2
)
order by 2,3 desc
;
//Totals By Brand vs. Category
with b as (select panel_cont_15m,
           case when barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR') then 'Sentry'
           end as BRAND,
    receipt_id,
    user_id,
    sum(ITEM_DISCOUNTED_EXTENDED_PRICE) as sales,           
    sum(ITEM_QUANTITY) as units
from "DATAVERSE"."FETCH360"."TRANSACTION360_IRI"
where 1=1
    and user_active=true
    and receipt_purchase_date::date between '2019-04-01' and '2021-04-30'
   and barcode_manufacturer in ('SERGEANTS PET PRODUCTS')
   --and barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR')
   and barcode_category_2 in ('CALMING COLLAR')
 group by 1,2,3,4
),
c as (select panel_cont_15m,
      case when barcode_brand in ('SERGANTS SENTRY','SERGANTS SENTRY HC GOOD BEHAVIOR') then 'Sentry'
           end as BRAND,
    barcode_manufacturer,
    receipt_id,
    user_id,  
    sum(ITEM_DISCOUNTED_EXTENDED_PRICE) as sales,
    sum(ITEM_QUANTITY) as units
from "DATAVERSE"."FETCH360"."TRANSACTION360_IRI"
where 1=1
    and user_active=true
    and receipt_purchase_date::date between '2019-04-01' and '2021-04-30'
    and barcode_category_2 in ('CALMING COLLAR')
 group by 1,2,3,4,5
),
b_15mcp as (select *
from b
where panel_cont_15m=true                       
-- group by 1,2,3,4,5
),
c_15mcp as (select *
from c
where panel_cont_15m=true                         
 --group by 1,2,3,4,5,6
)
select distinct
    type, sales, trips, users, units
from
//BRAND ALL USERS
(select distinct 'BRAND - ALL USERS' as type,
    sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from b
 group by 1
union
--CATEGORY ALL USERS
 select distinct 'TOTAL CATEGORY - ALL USERS' as type, 
 sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c
 group by 1
union
-- BRAND 15MCP 
 select distinct 'BRAND - 15MCP' as type,   
 sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from b_15mcp
 group by 1
union
-- CATEGORY 15MCP
select distinct 'TOTAL CATEGORY - 15MCP' as type,
    sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c_15mcp
 group by 1
 union
--OTHER
 select distinct 'OTHER - ALL USERS' as type,
    sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c
 where barcode_manufacturer not in ('SERGEANTS PET PRODUCTS')
 group by 1
 union
select distinct 'OTHER - 15MCP' as type,
    sum(sales) sales, count(distinct receipt_id) trips,count(distinct user_id) users, sum(units) units
 from c_15mcp
 where barcode_manufacturer not in ('SERGEANTS PET PRODUCTS') 
 group by 1
)
order by 2 desc
;
//** *Enable upload for webp image files.*/
function webp_upload_mimes($existing_mimes) {
    $existing_mimes['webp'] = 'image/webp';
    return $existing_mimes;
}
add_filter('mime_types', 'webp_upload_mimes');

//** * Enable preview / thumbnail for webp image files.*/
function webp_is_displayable($result, $path) {
    if ($result === false) {
        $displayable_image_types = array( IMAGETYPE_WEBP );
        $info = @getimagesize( $path );

        if (empty($info)) {
            $result = false;
        } elseif (!in_array($info[2], $displayable_image_types)) {
            $result = false;
        } else {
            $result = true;
        }
    }

    return $result;
}
add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
Para comprimir
Utiliza el comando:

zip -r tuarchivo.zip directorio

Para extraer
El comando es:

unzip tuarchivo.zip

Para comprimir todo incluso los archivos ocultos
Utiliza el comando:

zip -r tuarchivo.zip *
star

Sat May 08 2021 09:28:55 GMT+0000 (UTC) https://forums.macrumors.com/threads/full-disk-access-wont-let-me-add-apps.2232767/

@canering

star

Sat May 08 2021 09:28:34 GMT+0000 (UTC) https://apple.stackexchange.com/questions/71648/can-i-configure-accessbility-settings-using-terminal-instead-of-preferences-pane?rq

@canering

star

Sat May 08 2021 09:25:52 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 09:25:22 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 09:25:17 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 09:25:02 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 09:25:00 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 09:24:41 GMT+0000 (UTC) https://stackoverflow.com/questions/64842819/cant-run-app-because-of-permission-in-big-sur

@canering

star

Sat May 08 2021 07:38:30 GMT+0000 (UTC)

@Kaustav #javascript #nodejs

star

Sat May 08 2021 06:27:47 GMT+0000 (UTC) https://blog.xpnsec.com/bypassing-macos-privacy-controls/

@canering

star

Sat May 08 2021 03:41:06 GMT+0000 (UTC) https://macserialjunkie.com/forum/search.php?keywords

@canering

star

Sat May 08 2021 00:50:38 GMT+0000 (UTC) https://itectec.com/askdifferent/macos-login-script-for-deleting-contents-of-private-var-folders/

@canering

star

Sat May 08 2021 00:50:16 GMT+0000 (UTC) https://superuser.com/questions/229971/mac-os-x-where-to-find-chrome-and-firefox-temporary-files?rq

@canering

star

Sat May 08 2021 00:48:23 GMT+0000 (UTC)

@hereiskaye

star

Sat May 08 2021 00:38:08 GMT+0000 (UTC) https://www.programmersought.com/article/75741486905/

@canering

star

Sat May 08 2021 00:27:41 GMT+0000 (UTC) https://apple.stackexchange.com/questions/176371/can-i-delete-files-or-folders-from-private-var-folders/176374

@canering

star

Fri May 07 2021 21:51:24 GMT+0000 (UTC)

@slendabilt

star

Fri May 07 2021 21:16:16 GMT+0000 (UTC) https://www.w3schools.com/howto/howto_css_hero_image.asp

@bilgehanevren #css

star

Fri May 07 2021 19:05:54 GMT+0000 (UTC)

@slendabilt

star

Fri May 07 2021 18:53:41 GMT+0000 (UTC)

@hereiskaye

star

Fri May 07 2021 18:34:56 GMT+0000 (UTC)

@Alz #php #wordpress

star

Fri May 07 2021 18:34:23 GMT+0000 (UTC)

@Alz #php #wordpress

star

Fri May 07 2021 18:33:50 GMT+0000 (UTC)

@Alz #php #wordpress

star

Fri May 07 2021 18:25:16 GMT+0000 (UTC)

@Alz #php #wordpress #woocomerce

star

Fri May 07 2021 18:21:47 GMT+0000 (UTC)

@Alz #php #wordpress

star

Fri May 07 2021 18:15:24 GMT+0000 (UTC) https://wpdev.co.il/%d7%94%d7%92%d7%93%d7%a8%d7%94-%d7%90%d7%95%d7%98%d7%95%d7%9e%d7%98%d7%99%d7%aa-%d7%a9%d7%9c-%d7%9b%d7%95%d7%aa%d7%a8%d7%aa-alt-%d7%9b%d7%99%d7%aa%d7%95%d7%91-%d7%95%d7%aa%d7%99%d7%90%d7%95%d7%a8/

@Alz #php #wordpress

star

Fri May 07 2021 18:14:11 GMT+0000 (UTC)

@Alz #php

star

Fri May 07 2021 17:59:51 GMT+0000 (UTC) https://www.html5canvastutorials.com/blog/2012/06/custom-form-radio-checkbox/

@richard

star

Fri May 07 2021 14:41:26 GMT+0000 (UTC)

@zlucxie #json #cotrijal

star

Fri May 07 2021 13:42:30 GMT+0000 (UTC) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise

@Shubham

star

Fri May 07 2021 12:37:21 GMT+0000 (UTC) https://www.peterbe.com/plog/format-thousands-in-python

@ianh ##python ##pandas ##format

star

Fri May 07 2021 12:27:25 GMT+0000 (UTC) https://gist.github.com/coolaj86/ea4d402a3d2ed34c7bc3e91655f21516

@canering

star

Fri May 07 2021 10:23:55 GMT+0000 (UTC) https://stackoverflow.com/questions/65346127/how-to-detect-if-an-app-is-run-from-the-dmg-file

@canering #javascript

star

Fri May 07 2021 10:17:36 GMT+0000 (UTC) https://superuser.com/questions/1490116/charles-4-2-8-cannot-configure-your-proxy-settings-while-it-is-on-a-read-only-vo

@canering

star

Fri May 07 2021 09:15:19 GMT+0000 (UTC) https://superuser.com/questions/255176/is-there-a-list-of-available-boot-args-for-darwin-os-x

@canering

star

Fri May 07 2021 09:04:46 GMT+0000 (UTC) https://apple.stackexchange.com/questions/420029/how-to-update-the-system-preferences-cache-using-objective-c

@canering

star

Fri May 07 2021 05:56:55 GMT+0000 (UTC) https://github.com/kennethreitz-archive/index.py/blob/master/index.py

@leafsummer #python

star

Fri May 07 2021 02:40:27 GMT+0000 (UTC) https://brettterpstra.com/2013/08/29/popclip-hacking/

@canering

star

Fri May 07 2021 02:02:09 GMT+0000 (UTC) https://r4ds.had.co.nz/introduction.html

@suibhne

star

Fri May 07 2021 01:12:51 GMT+0000 (UTC) https://thp.io/2008/urlwatch/

@canering

star

Thu May 06 2021 23:11:17 GMT+0000 (UTC) https://github.com/dnote/doctor

@canering

star

Thu May 06 2021 22:50:09 GMT+0000 (UTC)

@k8hohenstatt

star

Thu May 06 2021 22:38:20 GMT+0000 (UTC)

@khathawut.1996

star

Thu May 06 2021 20:09:52 GMT+0000 (UTC)

@angelfilms

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension