This file contains 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
# chuck this in your ~/.local.bash or ~/.bash_profile | |
# usage: gitwho filename | |
function gitwho() { | |
echo -e "\n File: $1"; | |
echo -n " Last Commit:"; | |
echo -e "\033[35m \c"; | |
git log --relative-date --pretty='%aN (%ad)' -n1 $1; | |
echo -e "\033[35m \c"; | |
echo -n " - "; | |
git log -n1 --format="%s" $1; |
This file contains 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
alias gitchanges='git diff origin/master | grep "+++" | cut -d" " -f2' |
This file contains 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
/^(\".+\")=(\".+\")$/.test('":n\"ame"="value"') | |
console.log(RegExp.$1, RegExp.$2) |
This file contains 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
%w(a e i o u).map {|x| | |
['', 'a', 'e', 'i', 'o', 'u'].map {|y| | |
['', 'n', 'ng'].map {|z| (x!=y) ? 'ch' + x + y + z : nil } | |
} | |
}.flatten.uniq.compact |
This file contains 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 () { | |
if(!window.console) { | |
console = { | |
log: function() { | |
var str = ""; | |
for(var i = 0; i < arguments.length; i++) { | |
str += arguments[i]; | |
} | |
document.body.appendChild(document.createTextNode(str)); | |
document.body.appendChild(document.createElement('br')); |
This file contains 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/sh | |
# | |
# usage: ./imax.sh "tron 2" | |
# | |
# Note, this doesn't always work as it is clearly scrapping imdb. | |
# comment below for any suggested changes! | |
# | |
echo "Was it filmed in IMAX?" | |
q=`echo $1 | sed -e s/\ /\+/g` |
This file contains 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
if(!!navigator.userAgent.match('MSIE') && Math.floor(navigator.appVersion) === 6) { | |
alert("suckit..."); | |
} |
This file contains 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
class Foo | |
def self.foo(*args) | |
args.each { |arg| | |
print arg[arg.keys.first] | |
} | |
yield | |
end | |
end | |
puts Foo.foo({:beep => "hello"},{:word=>" "}){x={:word => "world"};Foo.foo({:word => "there"},{:word => " "}){{:hello =>{:there=>{:world =>x[:word]}}}}}[:hello][:there][:world] |
This file contains 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
QUnit.done = function(qunitReport) { | |
console.log(qunitReport.total); | |
}; | |
setTimeout(function() { | |
test("helloworld", function() { | |
expect( 1 ); | |
ok(true); | |
}); | |
}, 100); |
This file contains 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
require 'rubygems' | |
require 'json' | |
require 'open-uri' | |
# All your diggs, are belong to me | |
# I'm sure there is a better way, but this is a simple unauthenticated | |
# pull of digg counts for a URL. No bells.. No whistles.. | |
def getDiggs(url) | |
begin | |
response = open("http://widgets.digg.com/buttons/count?url=#{url}") |
NewerOlder