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
function subl() { | |
if [[ ! -p /dev/stdin ]]; then | |
command subl > /dev/null 2>&1 | |
fi | |
command subl "$@" | |
} |
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
<?xml version='1.0' encoding='utf-8'?> | |
<methodCall> | |
<methodName>wp.uploadFile</methodName> | |
<params> | |
<param><value><string>1</string></value></param> | |
<param><value><string>username</string></value></param> | |
<param><value><string>password</string></value></param> | |
<param> | |
<value> | |
<struct> |
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 | |
/** | |
* This little class records how long it takes each WordPress action or filter | |
* to execute which gives a good indicator of what hooks are being slow. | |
* You can then debug those hooks to see what hooked functions are causing problems. | |
* | |
* This class does NOT time the core WordPress code that is being run between hooks. | |
* You could use similar code to this that doesn't have an end processor to do that. | |
* |
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
#!/bin/bash | |
# Approximates the phase of the moon using a known new-moon time and a fixed lunar phase of 2551443 seconds. | |
# Outputs the phase as an emoji in UTF-8 | |
CHARS=( | |
"\xf0\x9f\x8c\x91" # 0 - NEW | |
"\xf0\x9f\x8c\x91" # 1 - NEW | |
"\xf0\x9f\x8c\x92" # 2 - WAXING CRESCENT |
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 | |
/** | |
* Generates a domain-mapping safe URL on WordPress.com | |
* Core's ajaxurl uses admin_url() which returns *.wordpress.com which doesn't work for the front-end on domain-mapped sites. | |
* This works around that and generates the correct URL based on context. | |
*/ | |
function my_admin_ajax_url( $path = '' ) { | |
if ( is_admin() ) | |
$url = admin_url( 'admin-ajax.php' ); | |
else |