This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SSH into the chip | |
ssh [email protected] | |
# Too many chips? You can remove the SSH Key for the previous chip with this | |
ssh-keygen -R chip.local | |
# List all available wifis | |
nmcli device wifi list | |
# Connect to the WIFI without a password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// eg. | |
static f.setup() { | |
// Redirect to front page if cart is empty | |
add_filter( 'woocommerce_return_to_shop_redirect', __CLASS__ . '::go_home_if_empty_cart_redirect_url', 10, 1 ); | |
} | |
/* Changes the redirect URL for the Return To Shop button in the cart. */ | |
static function go_home_if_empty_cart_redirect_url( $url ) { | |
return get_home_url(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE `wp_postmeta` | |
SET meta_value='taxable' | |
WHERE meta_key='_tax_status' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]]+(![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class craft_child_features { | |
static function setup() { | |
add_filter( 'craft_acf_parent_features', __CLASS__ . '::craft_child_remove_acf_groups' ); | |
} | |
/** | |
* [craft_child_remove_acf_groups description] | |
* @param [type] $features [description] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class f { | |
static function s() { | |
add_filter( 'the_title', __CLASS__ . '::split_product_title_at_pipe' ); | |
} | |
static function split_product_title_at_pipe( $title ) { | |
if ( ! is_product() ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* SQL LOGGING FOR PAGES */ | |
add_action( 'shutdown', 'sql_logger' ); | |
function sql_logger() { | |
global $wpdb; | |
$log_file = fopen( ABSPATH.'/sql_log.txt', 'a' ); | |
fwrite( $log_file, "//////////////////////////////////////////\n\n" . date( 'F j, Y, g:i:s a' )."\n" ); | |
foreach ( $wpdb->queries as $q ) { | |
fwrite( $log_file, $q[0] . " - ( $q[1] s )" . "\n\n" ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_email_before_order_table', __CLASS__ . '::before_order_email', 10, 4 ); | |
add_action( 'woocommerce_email_after_order_table', __CLASS__ . '::after_order_email', 10, 4 ); | |
// Add content before the order table | |
static function before_order_email( $order, $sent_to_admin, $plain_text, $email ) { | |
// If the emails links to the dashboard | |
if ( $sent_to_admin ) { | |
// email is plain text, not html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
static function setup(){ | |
add_filter( 'woocommerce_single_product_image_thumbnail_html', __CLASS__ . '::add_youtube_videos_to_thumbnails', 10, 2 ); | |
} | |
static function add_youtube_videos_to_thumbnails( $html, $attachment_id ) { | |
global $product; | |
$attachment_ids = $product->get_gallery_attachment_ids(); | |
$last_id = array_pop( $attachment_ids ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | |
# Copy key | |
nano ~/.ssh/authorized_keys | |
# ctrlx, y | |
# Or you can paste this: | |
cat ~/.ssh/id_rsa.pub | ssh user@server "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys" |