Skip to content

Instantly share code, notes, and snippets.

View bobthecow's full-sized avatar

Justin Hileman bobthecow

View GitHub Profile
@bobthecow
bobthecow / gist:425576
Created June 4, 2010 15:49
Best git alias ever!
[alias]
alias = "!sh -c '[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || [ $# = 1 ] && [ $1 = \"--list\" ] && git config --list | grep \"alias\\.\" | sed \"s/^alias\\.\\([^=]*\\)=\\(.*\\).*/\\1@@@@=>@@@@\\2/\" | sort | column -ts \"@@@@\" && exit 0 || echo \"usage: git alias <new alias> <original command>\\n git alias --list\" >&2 && exit 1' -"
@bobthecow
bobthecow / premailer_plugin.rb
Created May 9, 2010 06:36
Premailer gem plugin for Coda
#!/usr/bin/ruby
require 'rubygems'
require 'premailer'
require 'tempfile'
$stdout.flush
tmp_html = Tempfile.new('premailer')
@bobthecow
bobthecow / cdg.bash
Created April 29, 2010 15:45
cd relative to the current Git repo
#!/bin/bash
#
# cd relative to the current Git repo
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.cdg.bash`) and source it in `.bashrc`
#
{{#mustache}}
has mustache
{{:mustache}}{{! (this is an else...) !}}
{{#beard}}
has beard
{{/beard}}
{{/mustache}}
Each test run on 5000 total instances.
**1 classes:**
spl_object_hash() time: 0.0025229454040527
spl_object_hash_var_dump() time: 0.042062997817993
spl_object_hash_references() time: 1.8909840583801
**2 classes:**