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 | |
STD_IMG_REF = '/Users/paulcarey/.std_desktop_image.txt' | |
IMG_SRC = '/Users/paulcarey/dev/images/ir_black_bg.png' | |
def current_img | |
cmd = "defaults read com.apple.Desktop Background | grep ImageFilePath | tail -n 2 | head -n 1" | |
res = `#{cmd}` | |
res = res.split('=')[1].strip | |
res[1, res.size - 3] |
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
// Example 1 | |
function (clientCallback) { | |
redis.set('foo1', 'bar1'); | |
redis.set('foo2', 'bar2', clientCallback); | |
} | |
// Example 2 | |
function (clientCallback) { | |
redis.set('foo1', 'bar1', function () { | |
redis.set('foo2', 'bar2', clientCallback); |
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/bash | |
# Use the HOST_ENV variable to set the prompt color so the environment | |
# is obvious at the prompt | |
# Add it to .bashrc and optionally /etc/skel/.bashrc | |
function setprompt { | |
# Format is ESC[Value;...;Valuem |
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 | |
require 'rubygems' | |
require 'relaxdb' | |
require 'Ruby2Ruby' | |
require 'spec/spec_models' | |
c = Module.const_get ARGV[0] | |
s = RubyToRuby.translate c | |
puts s |
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
it "should know one another" do | |
# Code in the cdb block is executed if and only if it hasn't already been run. | |
cdb do | |
p1, p2 = Player.stock(:name => "p1"), Player.stock(:name => "p2") | |
p1.acquaint p2 | |
end | |
p1.should know(p2) # p1 and p2 are methods that load players by names p1 and p2 | |
p2.should know(p1) | |
end |
NewerOlder