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
# NOTE: see http://www.dribin.org/dave/blog/archives/2007/11/28/ssh_agent_leopard/ | |
# on leopard, DON'T run ssh-agent; just ssh-add and it will work. | |
export agentfile=/tmp/.ssh_agent | |
function start_ssh_agent() { | |
echo > $agentfile | |
chmod 600 $agentfile | |
ssh-agent > $agentfile | |
load_ssh_agent |
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 remember() { | |
echo -e "tell application \"Finder\"\n display dialog \"${@}\"\n end tell" | osascript & | |
disown | |
} |
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
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMM8?????????????????????????????????????????????????????NMMMMMMMMMMMMM | |
MMMMMMMMMMM=????????????????????????????????????????????????????????MMMMMMMMMMMM | |
MMMMMMMMMM8???????????????????????????????????????+O????????????????MMMMMMMMMMMM | |
MMMMMMMMMMO???????????????????????????????????????IM????????????????MMMMMMMMMMMM | |
MMMMMMMMMMO????????????????????+$NMN7+???NMZ??????I?????????????????MMMMMMMMMMMM | |
MMMMMMMMMMO?????8DO?+????????OMMMMMMMMMI?MMMMMD?????????????????????MMMMMMMMMMMM | |
MMMMMMMMMMO??++?=OMMMMMMO???ZMMMMMMMMMMMN??MMMMMMI??????????????????MMMMMMMMMMMM | |
MMMMMMMMMMO8NNMMMMMMMMMMMM7DMMMMMMMMMMMMM+??+I8MMM??????????????????MMMMMMMMMMMM |
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
module Spec | |
module Example | |
SLOW_SPECS_WARNING = "SKIPPED: CONTINUOUS INTEGRATION only (SLOW_SPECS=y)" | |
module ExampleGroupMethods | |
def skip_unless_ci | |
before(:each) { pending SLOW_SPECS_WARNING } unless ENV['SLOW_SPECS'] | |
end | |
alias :describe :context |
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
# strip whitespace before commit | |
for i in $(git diff-index --cached --name-only HEAD); do | |
EXISTS=$(git diff-files --name-only | grep $i); | |
if [ "$EXISTS" != "" ]; then | |
echo unstaged dirty changes for $i, not touching | |
else | |
perl -pe 's/[\t ]+$//g' -i $i; | |
git-add $i; | |
fi | |
done |
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
context 'unauthorized' do | |
it "ACK an attempt to CONNECT" do | |
result = json_request :command => 'CONNECT', :message_id => 'antarctica' | |
result['command'].should == "ACK" | |
result['message_id'].should == "antarctica" | |
end | |
it "send an ERROR for any message which is not a CONNECT" do | |
result = json_request :command => 'SHOWTABLES', :message_id => 'snoo', :location => 'wibble' | |
result['command'].should == "ERROR" |
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 | |
# | |
# Sample Ruby script using the Selenium client API | |
# | |
require 'rubygems' | |
gem "rspec", "=1.2.6" | |
gem "selenium-client", ">=1.2.16" | |
require "selenium/client" | |
require "selenium/rspec/spec_helper" |
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
# assumes a User model with restful_authentication and a string time_zone column | |
class ApplicationController < ActionController::Base | |
around_filter :set_timezone | |
def set_timezone | |
TzTime.zone = TimeZone[ current_user && current_user.time_zone || session[:utc_offset_hours] || 0 ] | |
yield | |
TzTime.reset! | |
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
module ApplicationHelper | |
def local_time(time) | |
capture_haml do | |
haml_tag :span, time.utc.to_s, :class => 'time' | |
end | |
end | |
def local_date(time) | |
capture_haml do |
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 | |
export FIREFOX=/Applications/Firefox.app | |
/usr/bin/open $FIREFOX $1 |