Skip to content

Instantly share code, notes, and snippets.

Justin Hileman bobthecow

View GitHub Profile
mikehale / jquery.copyable.js
Created Jan 21, 2010
A jquery API for ZeroClipBoard
View jquery.copyable.js
This script requires the jquery.includeMany plugin and ZeroClipboard.
$("#elementToClickOn").copyable(function(e, clip) {
stephanschubert / deferred_google_analytics.html
Created Apr 9, 2010
jQuery version of deferred Google Analytics. See for more details.
View deferred_google_analytics.html
<script type="text/javascript">
(function($) {
$("body").load(function() {
setTimeout(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
}, 1);
bobthecow / cdg.bash
Created Apr 29, 2010
cd relative to the current Git repo
View cdg.bash
# cd relative to the current Git repo
# Author: Justin Hileman (
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.cdg.bash`) and source it in `.bashrc`
View .gitconfig
edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; $EDITOR `f`"
add-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; git add `f`"
lc = log ORIG_HEAD.. --stat --no-merges
smash = merge --no-commit --log
eat = branch -M
prune-all = !git remote | xargs -n 1 git remote prune
whois = "!sh -c 'git log -i --pretty=\"format:%an <%ae>\" --author=\"$1\" | sort -u' -"
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
bobthecow / cdd.bash
Created Jun 21, 2010
Change directories really fast
View cdd.bash
# Change directories really really fast
# Author: Justin Hileman (
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.cdd.bash`) and source it in `.bashrc`
bobthecow / .gitconfig
Created Jul 6, 2010
`git todo` alias is the hotness.
View .gitconfig
# install t first:
todo = !python ~/path/to/ --task-dir "$(git rev-parse --show-toplevel)" --list TODO
bug = !python ~/path/to/ --task-dir "$(git rev-parse --show-toplevel)" --list BUGS
View bench1
HTMLPurifier Pass #1 - Small File:
marker time index ex time perct
Start 1278617711.57713300 - 0.00%
Stop 1278617715.11053700 3.533404 100.00%
View prepare-deploy.rb
#! /usr/bin/env ruby
# this script takes your current commit, finds all the submodules in it,
# makes them static files in a new tree and updates a branch called 'heroku'
# - this way you can push a project with submodules to heroku easily
# just run this, then run "git push heroku heroku:master"
current_commit = `git rev-parse HEAD`
current_tree = `git rev-parse HEAD^{tree}`
puts "Starting at tree #{current_tree}"
ken-reitz /
Created Oct 10, 2010
GitHub Syncer. Clones or Pulls all GitHub repos (including watched list).
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Kenneth Reitz's GitHub Syncer
This script uses the GitHub API to get a list of all forked, mirrored, public, and
private repos in your GitHub account. If the repo already exists locally, it will
update it via git-pull. Otherwise, it will properly clone the repo.
It will organize your repos into the following directory structure:
View MustacheCallTest.php
require_once '../Mustache.php';
class MustacheCallTest extends PHPUnit_Framework_TestCase {
public function testCallEatsContext() {
$foo = new Foo();
$foo->name = 'Bob';
You can’t perform that action at this time.