Skip to content

Instantly share code, notes, and snippets.

View danielbachhuber's full-sized avatar

Daniel Bachhuber danielbachhuber

View GitHub Profile
@ryanpitts
ryanpitts / Hartnett Command Performance
Created May 11, 2011 19:11
Let your Mac read you the latest @wmhartnett updates from Twitter
read -a choices <<<'Agnes Kathy Princess Vicki Victoria Bruce Fred Junior Ralph Albert Bahh Bells Boing Bubbles Cellos Deranged Hysterical Trinoids Whisper Zarvox'; n=${#choices[*]}; voice=${choices[$((RANDOM%n))]}; curl https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=wmhartnett | grep '<description>.*</description>' | sed -e 's/<\/*description>//g' -e 's/ \/ wmhartnett//g' -e 's/wmhartnett: //g' | say -v $voice
@mjangda
mjangda / github-post-receive-pull.php
Created November 16, 2010 06:47
Quick and dirty script that can auto-pull to keep your repo up-to-date any time something is pushed to the remote repo
<?php
// Edit these to match your environment settings
define( 'BASE_PATH', '/home/username/webapps' );
// This is the path to the git executable
define( 'GIT_PATH', get_full_path( '/git/bin/git' ) );
// Edit this array so the key matches the github repo name and the value is path of the repo relative to the BASE_PATH
$repository_paths = array(
'test' => '/git-test'
@mjangda
mjangda / edit-flow_usergroups_caps.php
Created October 12, 2010 01:58
Add necessary caps to admin and editor roles to manage usergroups
add_action( 'admin_init', 'ef_usergroups_cap_fix' );
function ef_usergroups_cap_fix() {
global $wp_roles;
if ( ! isset( $wp_roles ) )
$wp_roles = new WP_Roles();
// Add necessary capabilities to allow management of usergroups and post subscriptions
// edit_post_subscriptions - administrator + editor