An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
An introduction to curl
using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:
sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n
You don't have to put the library in /usr/lib/wpi18n
, but if you don't put it there, make sure to set the $WP_I18N_LIB
environment variable in your .bashrc
file (with no trailing slash):
export WP_I18N_LIB="/path/to/i18n/lib"
# Alias ST2's command line tool for a shorter (easier-to-remember) name | |
alias st="/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl" | |
# Search for and open WordPress hooks | |
function action() { | |
ack "do_action\(\s*('|\")$1('|\")" | awk {'print $1'} | sed 's/:$//g' | xargs st | |
} | |
function filter() { | |
ack "apply_filters\(\s*('|\")$1('|\")" | awk {'print $1'} | sed 's/:$//g' | xargs st | |
} |
To install, you need to have the WordPress i18n library on your computer. Check it out using SVN:
sudo svn co http://i18n.svn.wordpress.org/tools/trunk/ /usr/lib/wpi18n
You don't have to put the library in /usr/lib/wpi18n
, but if you don't put it there, make sure to set the $WP_I18N_LIB
environment variable in your .bashrc
or .bash_profile
file (with no trailing slash):
export WP_I18N_LIB="/path/to/i18n/lib"
<?php | |
/** | |
* GitHub webhook handler template. | |
* | |
* @see https://docs.github.com/webhooks/ | |
* @author Miloslav Hůla (https://github.com/milo) | |
*/ | |
$hookSecret = 's.e.c.r.e.t'; # set NULL to disable check |
#!/bin/sh | |
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"` | |
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php` | |
# Determine if a file list is passed | |
if [ "$#" -eq 1 ] | |
then | |
oIFS=$IFS | |
IFS=' |
<?php | |
class My_Custom_My_Account_Endpoint { | |
/** | |
* Custom endpoint name. | |
* | |
* @var string | |
*/ | |
public static $endpoint = 'my-custom-endpoint'; |
This simple script is for logging all of the awesome things you do every day, using Terminal, and syncing them all to Dropbox. Nifty, right?
idid.sh
file to a directory on your computer (tested with OS X).idid.sh
, run the following commands:mv idid.sh /usr/local/bin/idid.sh
/** | |
* Configure PHPMailer to send via PHP's mail() | |
* | |
* @param PHPMailer $phpmailer | |
*/ | |
function phpmailer_send_via_mail( $phpmailer ) { | |
$phpmailer->IsMail(); | |
} | |
add_action( 'phpmailer_init', 'phpmailer_send_via_mail', 999 ); |