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
clear | |
history -c && rm -f ~/.bash_history |
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
Story: Account Holder withdraws cash | |
As an Account Holder | |
I want to withdraw cash from an ATM | |
So that I can get money when the bank is closed | |
Scenario 1: Account has sufficient funds | |
Given the account balance is \$100 | |
And the card is valid | |
And the machine contains enough money |
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
unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks | |
vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first | |
$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? | |
begin | |
require 'cucumber/rake/task' | |
namespace :hudson do | |
def report_path | |
"hudson/report/features" |
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 Rails::Boot | |
def run | |
load_initializer | |
Rails::Initializer.class_eval do | |
def load_gems | |
@bundler_loaded ||= Bundler.require :default, Rails.env | |
end | |
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
begin | |
require "rubygems" | |
require "bundler" | |
rescue LoadError | |
raise "Could not load the bundler gem. Install it with `gem install bundler`." | |
end | |
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24") | |
raise RuntimeError, "Your bundler version is too old for Rails 2.3." + | |
"Run `gem install bundler` to upgrade." |
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
source :gemcutter | |
gem "rails", "~> 2.3.5" | |
gem "sqlite3-ruby", :require => "sqlite3" | |
# bundler requires these gems in all environments | |
# gem "nokogiri", "1.4.2" | |
# gem "geokit" | |
group :development do | |
# bundler requires these gems in development |
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
# Original URL => http://www.tiplib.com/150/change-permissions-only-directories | |
find . -type d -exec chmod a+x {} \; |
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
# Phillip Koebbe from Ruby on Rails suggested inserting following code between the "bootstrap" and | |
# "initialize" sections of enviroment.rb. This hack fixes the problem. | |
if Gem::VERSION >= "1.3.6" | |
module Rails | |
class GemDependency | |
def requirement | |
r = super | |
(r == Gem::Requirement.default) ? nil : r | |
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
# Taken from http://rcos.cs.rpi.edu/projects/flagship-safety/commit/converting-hex-color-rrggbb-to-kml-color-aabbggrr/ | |
# | |
# Generates a KML color given a hex color string. | |
# Converts the format from #RRGGBB to AABBGGRR. | |
# The alpha channel defaults to ff. | |
def to_kmlcolor(color="#000000", alpha = "ff") | |
alpha + color[5,3] + color[3,2] + color[1,2] | |
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
<?php | |
class Number | |
{ | |
function spell($number) | |
{ | |
$words = array( | |
"", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh", | |
"Delapan", "Sembilan", "Sepuluh", "Sebelas" | |
); |