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
rvm install 1.8.7 --debug -C --with-readline-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr,--enable-shared | |
rvm 1.8.7 | |
wget http://downloads.sourceforge.net/project/rubycocoa/RubyCocoa/1.0.1/RubyCocoa-1.0.1.tar.gz?use_mirror=superb-sea2 | |
tar zxf RubyCocoa-1.0.1.tar.gz | |
cd RubyCocoa-1.0.1 | |
ruby install.rb config --target-archs=x86_64 | |
ruby install.rb setup | |
rvmsudo ruby install.rb install | |
gem install xrefresh-server |

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 'spec/runner/formatter/progress_bar_formatter' | |
# Put this in spec/support and run with: | |
# spec spec --require spec/support/no_shoulds_punk_formatter.rb --format NoShouldsPunkFormatter | |
class NoShouldsPunkFormatter < Spec::Runner::Formatter::ProgressBarFormatter | |
def initialize(options, output) | |
super | |
@examples_with_should = [] |
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 'webrick' | |
require 'webrick/httpproxy' | |
require 'fileutils' | |
require 'md5' | |
### | |
# FakeWebRecorder is an HTTP Proxy that records sessions as calls to FakeWeb. | |
# The code that FakeWebRecorder generates should be suitable for testing | |
# interaction with a particular website. | |
# |
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
When /^(.*) in the "([^\"]*)" section$/ do |action, title| | |
within "//*[(h1|h2|h3|h4|h5|h6|legend|caption)/descendant-or-self::*[contains(text(), '#{title}')]]" do | |
When action | |
end | |
end | |
When /^(.*) in the "([^\"]*)" row$/ do |action, title| | |
within "//*[(th|td)/descendant-or-self::*[contains(text(), '#{title}')]]" do | |
When action | |
end |
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 'strscan' | |
require 'set' | |
class SqlQuery < Struct.new(:table, :where, :order) | |
def to_json | |
[table, where, order].to_json | |
end | |
end | |
class SqlScanner |
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
# Neater Github gem dependencies for Rails | |
module GithubGem | |
def github_gem(gem_name, opts={}) | |
lib_name = gem_name.split('-', 2)[1] | |
self.gem gem_name, {:lib => lib_name, :source => 'http://gems.github.com'}.merge(opts) | |
end | |
end | |
Rails::Initializer.run do |config| |
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 defined?(ActiveResource) | |
# Makes activeresource properly encode records | |
class ActiveResource::Base | |
cattr_accessor :include_root_in_json, :instance_writer => false | |
def encode(options={}) | |
case self.class.format | |
when ActiveResource::Formats::XmlFormat | |
self.class.format.encode(attributes, {:root => self.class.element_name}.merge(options)) | |
when ActiveResource::Formats::JsonFormat |
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 edithosts { | |
if [ -x "`which $EDITOR`" ] || [ -x "`which $1`" ] | |
then | |
if [ -x "`which $EDITOR`" ] | |
then | |
export TEMP_EDIT="`which $EDITOR`" | |
else | |
export TEMP_EDIT="`which $1`" | |
fi | |
echo "* Using ${TEMP_EDIT} as editor" |
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
module PythonishDecorator | |
def method_added(name) | |
return unless @decorations | |
decorations = @decorations.dup | |
@decorations = nil | |
alias_method "undecorated_#{name}", name | |
define_method(name) do |*args| |