Skip to content

Instantly share code, notes, and snippets.

View robertbrook's full-sized avatar

Robert Brook robertbrook

View GitHub Profile
describe Act do
describe "when asked for name and year" do
it 'should return "Abdication Act" for Act with title "Abdication Act" and nil year' do
act = Act.new(:name => "Abdication Act")
act.name_and_year.should == "Abdication Act"
end
it 'should return "Access to Health Records Act 1990" for Act with title "Access to Health Records Act" and year 1990' do
describe HansardReference, 'when creating a reference' do
# checking matches #
it 'should match date in "27 October 2003, Official Report, column 55W"' do
should_match '27 October 2003, Official Report, column 55W'
end
it 'should match on "10 February 2004, Official Report, columns 1293–98W"' do
should_match '10 February 2004, Official Report, columns 1293–98W'
@robertbrook
robertbrook / .vimrc
Created January 21, 2011 20:29
My Vim config
set nocompatible
set autoindent
set smartindent
set showmatch
set ruler
set incsearch
set hlsearch
set showcmd
set ignorecase
set ttyfast
@robertbrook
robertbrook / .muttrc
Created January 21, 2011 20:45
My Mutt config
# I've not included my IMAP config
set timeout = 0
set mail_check = 0
# I've not included my SMTP config
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates
@robertbrook
robertbrook / gist:802274
Created January 29, 2011 22:29
taskwarrior
view layout [ text-list 600x200 data read/lines %completed.data button "ok" ]
deposit_ref = ""
deposit_leg = ""
deposit_date = ""
if td.get('class') == "ref":
deposit_ref = td.text_content()
elif td.get('class') == "leg":
deposit_leg = td.text_content()
<!--
RewriteEngine on
RewriteRule ^([a-zA-Z0-9]+)$ index.php?$1 [L]
RewriteRule ^([a-zA-Z0-9]+)/$ index.php?$1 [L]
-->
<?php
require 'redcloth'
require 'erb'
task :default => [:test]
TEXTFILES = FileList['**/*.txt']
desc "list txt files"
task :test do
puts TEXTFILES
$feedUrl = 'http://www.theyworkforyou.com/search/rss/?s="'.$thequery.'"';
$rawFeed = file_get_contents($feedUrl);
$xml = new SimpleXmlElement($rawFeed);
foreach ($xml->channel->item as $item)
{
echo "<article>";
echo '<p><a title="'.$item->link.'" href="'.$item->link.'">'.$item->title.'</a><!-- <br/><span class="abstract">' . $item->description . '</span> -->';
do http://reb4.me/r/altjson.r
board:to-string read http://countdown.tfl.gov.uk/stopBoard/58284
boardblock: load-json/flat board
foreach arrival boardblock/<arrivals> [print [arrival/<routeId> "to" arrival/<destination> arrival/<estimatedWait>]]