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
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@machine$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |
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
<nav> | |
<div> | |
<ul> | |
<li> | |
<a href="#">First</a> | |
</li> | |
<li> | |
<a href="#">Second</a> | |
</li> | |
<li> |
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
svn log http://develop.svn.wordpress.org/trunk -r 26861:HEAD | ack -i "props" | ack -ic "DrewAPicture" |
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 | |
/** | |
* List contributor props from most to least | |
* | |
* @param string $url (optional) The SVN repo URL. | |
*/ | |
function ww_svn_log_props( $url = 'http://core.svn.wordpress.org/trunk' ) { | |
$log = get_transient( '36_log' ); // 12 Hour transient | |
if ( ! $log ) { | |
$log = shell_exec( 'svn log -r 23171:HEAD --xml ' . esc_url( $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
<a href="javascript:(function(){var split=window.location.pathname.split('/');location.href='http://plugins.svn.wordpress.org/' + split[2] + '/trunk/'})();">Plugin Repo</a> |
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
for i in `cat unusual.txt`; do echo "$RANDOM $i"; done | sort | sed -E 's/^[0-9]+ //' > randorder.txt |
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
<? | |
/** | |
* Repeatable Custom Fields in a Metabox | |
* Author: Helen Hou-Sandi | |
* | |
* From a bespoke system, so currently not modular - will fix soon | |
* Note that this particular metadata is saved as one multidimensional array (serialized) | |
*/ | |
function hhs_get_sample_options() { |
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
#!/bin/bash | |
# usage: ORIG=###### NEW=###### ./gistmerge.sh | |
# $ORIG = The Gist ID of your Gist | |
# $NEW = The Gist ID of the fork | |
# Note: chmod u+x gistmerge.sh may be necessary | |
# if you're getting permissions errors | |
printf "\n\n... Cloning original Gist.\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
http://codex.wordpress.org/Function_Reference/get_attached_audio | |
http://codex.wordpress.org/Function_Reference/get_attached_video | |
http://codex.wordpress.org/Function_Reference/get_attached_images | |
http://codex.wordpress.org/Function_Reference/get_attached_image_srcs | |
http://codex.wordpress.org/Function_Reference/get_content_media | |
http://codex.wordpress.org/Function_Reference/get_content_audio | |
http://codex.wordpress.org/Function_Reference/get_content_video | |
http://codex.wordpress.org/Function_Reference/get_content_images | |
http://codex.wordpress.org/Function_Reference/get_content_image | |
http://codex.wordpress.org/Function_Reference/get_content_galleries |
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 | |
/** | |
* @param array $date_query { | |
* @type string 'column' (optional) Column to query against, default is 'post_date'. | |
* @type string 'compare' (optional) Comparison operator, defaul is '='. @see WP_Date_Query::get_compare() | |
* @type string 'relation' (optional) How the sub-arrays should be compared, accepts 'AND' (default) or 'OR'. | |
* } |