This file contains hidden or 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <sys/time.h> | |
int size; | |
int size_minus_1; | |
struct move { | |
int x; |
This file contains hidden or 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
#define B(x) x; printf("{ B(" #x ") }\n"); | |
int main() | |
{ B(printf("#define B(x) x; printf(\"{ B(\" #x \") }\\n\");\nint main()\n")) } |
This file contains hidden or 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 | |
if [ ! -d ./.git ] | |
then | |
echo "Not a git repository" | |
exit | |
fi | |
if [ $# -ne 1 ] | |
then | |
echo "Please provide a branch name to create and switch to" | |
exit |
This file contains hidden or 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}") |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
OlderNewer