Skip to content

Instantly share code, notes, and snippets.

View andrewplummer's full-sized avatar
🙃

Andrew Plummer andrewplummer

🙃
View GitHub Profile
@andrewplummer
andrewplummer / gist:3837643
Created October 5, 2012 01:59
jQuery Bookmarklet
javascript:var%20i,s,ss=['https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0);
@andrewplummer
andrewplummer / github_show.sh
Last active October 10, 2015 19:38
Open a link to a file in Github from the command line.
#!/usr/bin/env ruby
require 'open-uri'
if ARGV.length == 0
puts <<-MESSAGE
GitHub Show Script
------------------
@andrewplummer
andrewplummer / gist:3087484
Created July 11, 2012 02:03
Dragonfly bug?
// Coming in:
//
// weekday = 40;
// d = new Date(2012, 1, 1);
// utc = false;
// prefer = 1;
// callDateMethod with those arguments is equivalent to "d.getDay()" and will return 3;
// When the bug occurs, weekday will become 47, where in every other browser it should remain 40 as:
// callDateMethod(...) IS 3 AND 40 % 7 IS 5
var sound = 'woof';
function bark(s) {
if(!s) {
return sound;
} else {
var sound = 'ruff';
return sound + s;
}
}
@andrewplummer
andrewplummer / gist:1868213
Created February 20, 2012 07:07
Git bash aliases with tab completion
#!/bin/sh
# Git related aliases
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
__define_git_completion () {
eval "