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
#!/usr/bin/env ruby | |
file="~/.gitshots/#{Time.now.to_i}.jpg" | |
unless File.directory?(File.expand_path("../../rebase-merge", __FILE__)) | |
puts "Taking capture into #{file}!" | |
system "imagesnap -q -w 3 #{file} &" | |
end | |
exit 0 |
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
var thing = { | |
a: true, | |
b: false, | |
c: 0, | |
d: null, | |
e: undefined | |
}; | |
console.log( '\n\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
var IndexRoutes = require( 'index' ); | |
var indexRoutes; | |
indexRoutes = routes.generate({ | |
config = options.config; | |
logger = options.logger; | |
Metric = options.Metric; | |
}); |
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
from facepy import GraphAPI | |
import json | |
# connect to facebook | |
oauth_access_token = [TOKEN_HERE] | |
graph = GraphAPI(oauth_access_token) | |
# get friend list |
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 Tree | |
attr_accessor :children, :node_name | |
def initialize(tree) | |
tree.each { |name, branches| | |
@node_name = name | |
@children = [] | |
branches.each_slice(1) { |branch| | |
@children.push(Tree.new(branch)) | |
} |
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
oldDivision := Number getSlot("/") | |
Number / := method( a, | |
if( a <= 0, 0, self oldDivision( a ) ) | |
) | |
writeln( 1 / 2 ) # prints "0.5" | |
writeln( 1 / 1 ) # prints "1" | |
writeln( 1 / 0 ) # prints "0" |
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
oldSpeakAddition := Number getSlot("+") | |
Number + := method( a, | |
if( a == 2 and self == 2, 5, self oldSpeakAddition( a ) ) | |
) | |
writeln( 1 + 1 ) # prints "2" | |
writeln( 1 + 2 ) # prints "3" | |
writeln( 2 + 2 ) # prints "5" |
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
/*global*/ | |
/*jslint node:true*/ | |
'use strict'; | |
var http = require( 'http' ), | |
url = require( 'url' ), | |
events = require( 'events' ), | |
util = require( 'util' ), | |
FakeServer; |
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
namespace('test', function () { | |
desc('Run server tests'); | |
task('server', [], function () { | |
jake.exec('mocha spec', function () { | |
console.log('Server tests passed'); | |
complete(); | |
}); | |
}); | |
desc('Run client tests'); |
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
// Create an instance of winston using our settings file determined by NODE_ENV | |
var winston = require( 'winston' ), | |
settings = ( process.env.NODE_ENV === 'production' ) | |
? require( '../settings.json' ).production.logger | |
: require( '../settings.json' ).development.logger | |
var transports = []; | |
if( settings.console ) { |