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
# Name - Salary - Expenditure - Total | |
[["Bradley, Maurice", 49500.0, 60580.37, 110080.37], | |
["Bradley, Paula", 49500.0, 66747.0, 116247.0], | |
["Buchanan, Keith", 49500.0, 61202.03, 110702.03], | |
["Buchanan, Thomas", 49500.0, 76984.56, 126484.56], | |
["Buckley, Jonathan", 49500.0, 11482.8, 60982.8], | |
["Bunting, Joanne", 49500.0, 63381.17, 112881.17], | |
["Cameron, Pam", 49500.0, 76676.94, 126176.94], | |
["Clarke, Trevor", 37537.5, 65933.83, 103471.33], |
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
type Animator struct { | |
Strip *strip.LEDStrip | |
Effects []effects.Effect | |
Running bool | |
} | |
func (a *Animator) Run(interval time.Duration) {} | |
func (a *Animator) Render() { |
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
Install "PowerBlock" (freeware) from this site: http://www.irradiatedsoftware.com/labs/ | |
Choose "Run AppleScript when power button is pressed" | |
Make it run this AppleScript: | |
do shell script "open /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app" |
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
# stop postgres | |
pg_ctl -D /usr/local/var/postgres stop && | |
# obliterate old postgres data | |
rm -Rf /usr/local/var/postgres && | |
# fresh start.. | |
initdb /usr/local/var/postgres -E utf8 && | |
# start postgres | |
pg_ctl -D /usr/local/var/postgres start |
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
#!/usr/bin/env ruby | |
unless ARGV.length >= 2 | |
STDERR.puts "git old <commit/refspec> <file> [file2] ..." | |
Kernel.exit(1) | |
end | |
ref = ARGV.shift | |
ARGV.each { |f| `git show #{ref}:#{f} | $EDITOR` } |
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
# helper | |
def with_stubbed_yml_config(yml, &block) | |
# stub, yield, unstub | |
end | |
# in examples.. | |
with_stubbed_yml_config(<<-YML) { url.should == 'http://test:5984' } | |
test: |
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
# sometimes I just want a quick-and-dirty thing to shove attributes onto without caring. | |
class Bucket | |
def method_missing(*args) | |
prop = args.first.to_s.sub(/\=$/, '').to_sym | |
self.class.send :attr_accessor, prop | |
send *args | |
end | |
end |
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
window?.exports = window # allows more conventional client-side 'exporting' | |
# nicer timeouts/intervals in coffeescript | |
exports.timeout = (ms, fn) -> setTimeout(fn, ms) | |
exports.interval = (ms, fn) -> setInterval(fn, ms) |
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
String.prototype.__defineGetter__('proc', function() { | |
var prop = this; | |
return function(obj) { | |
if(typeof obj[prop] == 'function') | |
return obj[prop](); | |
return obj[prop]; | |
} | |
}); |
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 Timer(func, delay, start) { | |
this.func = func; | |
this.delay = delay; | |
this.running = false; | |
if(start) this.start(); | |
} | |
Timer.prototype.start = function(delay) { | |
this.running = true; | |
return this.interval = setInterval(this.func, (delay || this.delay)); |
NewerOlder