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
begin | |
require 'less' | |
rescue LoadError | |
begin | |
config.gem "less" | |
require 'less' | |
rescue LoadError | |
puts "Please install the Less gem, `gem install less`." | |
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
Rules | |
===== | |
1. write exactly ONE failing test | |
2. make the test from (1) pass by first writing implementation code IN THE TEST | |
3. create a new implementation method/function by: | |
1. doing extract method on implementation code created as per (2), or | |
2. moving implementation code as per (2) into an existing implementation method | |
4. only ever create new methods IN THE TEST CLASS | |
5. only ever create implementation classes to provide a destination for extracting a method created as per (4). |
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
<html> | |
<head> | |
<title>Example Notice</html> | |
<style type="text/css"> | |
body { font-family: helvetica; } | |
#notice { | |
color: #fff; | |
position: absolute; | |
width: 300px; | |
top: 5px; |
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
.*.sw? |
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
require 'rubygems' | |
require 'spec' | |
class Account | |
attr_reader :balance | |
def self.find(pin) | |
Accounts[pin] | |
end | |
def initialize(ref,balance=0) |
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
Feature: a quiz | |
Background: | |
Given the quiz is configured with the questions: | |
""" | |
[ | |
{"key": "foo", "question": "1+1", "answer": "2", "reference-url": "foo.html"}, | |
{"key": "bar", "question": "1x3", "answer": "3", "reference-url": "bar.html"} | |
] | |
""" |
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
:map <leader>rt :!rvm <ruby>@<gemset> exec rspec --no-color %<cr> | |
:map <leader>rT :execute ":!rvm <ruby>@<gemset> exec rspec --no-color %:".line('.')<cr> |
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
app = proc do |env| | |
puts Rack::Request.new(env).params.inspect | |
[ 200, {'Content-Type' => 'text/plain'}, ["a"] ] | |
end | |
run 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
ack "stub\!?\(:(today|now)" spec |
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 bash | |
echo "Trains from Southampton Airport Parkway to Clapham Junction" && curl --silent \ | |
--user-agent "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7" \ | |
--referer "http://ojp.nationalrail.co.uk/en/s/ldbboard/dep/HYN/GLQ/To" \ | |
"http://ojp.nationalrail.co.uk/en/s/ldb/liveTrainsJson?departing=true&liveTrainsFrom=Southampton+Airport+Parkway&liveTrainsTo=Clapham+Junction&serviceId=" \ | |
| sed -e 's/[{"&;/"}]/''/g' | sed -e 's/ltbrgt/-''/g' | \ | |
awk '{n=split($0,a,","); for (i=6; i<=n-2; i++) { printf("%s %-25s %-20s\n",a[i+0],a[i+1],a[i+2]); i+=5}}' |