cd ~/.virtualenvs/myvirtualenv/lib/python2.x/site-packages
echo 'import sys;sys.setdefaultencoding("utf-8")' > sitecustomize.py
to automatically create a sitecustomize.py every time you create a virtualenv, edit your
<?php | |
add_filter( 'wp_link_query', 'seren_wp_link_query_term_linking', 99, 2 ); | |
function seren_wp_link_query_term_linking( $results, $query ) { | |
// Query taxonomy terms. | |
$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'names' ); | |
$terms = get_terms( $taxonomies, array( | |
'name__like' => $query['s'], | |
'number' => 20, |
https://www.guyrutenberg.com/2014/05/02/make-offline-mirror-of-a-site-using-wget/ | |
Sometimes you want to create an offline copy of a site that you can take and view even without internet access. Using wget you can make such copy easily: | |
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent http://example.org | |
Explanation of the various flags: | |
--mirror – Makes (among other things) the download recursive. | |
--convert-links – convert all the links (also to stuff like CSS stylesheets) to relative, so it will be suitable for offline viewing. |
#!/bin/bash | |
BUCKET=$1 | |
PREFIX=$2 | |
aws s3api list-object-versions --bucket $BUCKET --prefix $PREFIX --output text | | |
grep "DELETEMARKERS" | while read OBJECTS | |
do | |
KEY=$( echo $OBJECTS| awk '{print $3}') | |
VERSION_ID=$( echo $OBJECTS | awk '{print $5}') |
sudo launchctl stop com.apple.bluetoothd |
<?php | |
add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) { | |
$phpmailer->SMTPOptions = array( | |
'ssl' => array( | |
'verify_peer' => false, | |
'verify_peer_name' => false, | |
'allow_self_signed' => true | |
) | |
); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
add_action( 'phpmailer_init', function( $phpmailer ) { | |
$phpmailer->addCustomHeader("X-Mailgun-Drop-Message: yes"); | |
}); |
<?php | |
function darpar_body_class( $classes ) { | |
if ( is_singular() && has_post_thumbnail() ) { | |
array_push( $classes, 'has-thumbnail' ); | |
} | |
if ( is_product_category() && get_woocommerce_term_meta( get_queried_object_id(), 'thumbnail_id', true ) ) { | |
array_push( $classes, 'emyr' ); | |
}; |
<?php | |
// Add slug in CSS class of all sliders | |
add_filter( 'tgmsp_slider_classes', 'clinicoftcm_slider_classes', 10, 2 ); | |
function clinicoftcm_slider_classes( $classes, $id ) { | |
$slider = get_post( $id, ARRAY_A ); | |
if( $slider['post_name'] ) | |
$classes[] = 'soliloquy-' . $slider['post_name']; | |
return $classes; | |
} |