⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains 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_filter( 'hsd_get_user_customer_ids', 'check_hsd_customer_id', 999, 2 ); | |
check_hsd_customer_id( $hsd_ids, $user_id ) { | |
if ( $hsd_ids ) { | |
$now = current_time( 'timestamp' ); | |
$last_sync = get_user_meta( $user_id, 'pp_hsd_last_sync', true ); | |
if ( ! $last_sync || $last_sync <= ( $now - ( HOUR_IN_SECONDS * 6 ) ) ) { |
This file contains 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
# Install SublimeText | |
# ST2 | |
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages | |
# ST3 | |
cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages | |
# Install mCSS | |
git clone git://github.com/minimaldesign/mCSS.tmbundle.git "mCSS.tmbundle" |
This file contains 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 | |
/* | |
Usage: | |
$frag = new CWS_Fragment_Cache( 'unique-key', 3600 ); // Second param is TTL | |
if ( !$frag->output() ) { // NOTE, testing for a return of false | |
functions_that_do_stuff_live(); | |
these_should_echo(); | |
// IMPORTANT | |
$frag->store(); | |
// YOU CANNOT FORGET THIS. If you do, the site will break. |
This file contains 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 | |
/** | |
* WordPress Chosen Taxonomy Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* Use Chosen for a replacement taxonomy metabox in WordPress | |
* Useful for taxonomies that aren't changed much on the fly and are | |
* non-hierarchical in nature, as Chosen is for flat selection only. | |
* You can always use the taxonomy admin screen to add/edit taxonomy terms. | |
* Categories need slightly different treatment from the rest in order to |