Skip to content

Instantly share code, notes, and snippets.

View sskirby's full-sized avatar

Sean Kirby sskirby

  • Nulogy Corp.
  • Toronto, Ontario
View GitHub Profile
@sskirby
sskirby / event_types_controller_spec.rb
Created February 3, 2012 20:01
Sample controller spec
require 'spec_helper'
describe EventTypesController do
login_user
let(:m) {mock_model(EventType)}
describe "GET index" do
it "assigns all event_types as @event_types" do
EventType.should_receive(:all).and_return m
@sskirby
sskirby / cpireview.sh
Created February 1, 2012 21:40
Dev review script for the CPI project
#!/usr/bin/zsh
# Outputs a github link that you can click on to see the diff
if [[ -n $1 ]]; then
git log --pretty=oneline | egrep "Merge branch '${1}.*'.*" | awk '{print "https://github.com/nulogy/cpi/commit/" $1}'
fi
@sskirby
sskirby / grepfactor
Created December 6, 2011 16:08
Ruby script to open a vim window for each file whose content matches a regex
#!/usr/bin/env ruby
if ARGV.size < 2
puts 'grepfactor <search string> <location1>[ <location2> <location3>...]'
exit
end
lines = []
puts 'grepping....'
`grep -rn --color #{ARGV[0]} #{ARGV[1..-1].join(" ")}|grep -v swp`.each do |l|
@sskirby
sskirby / gist:673176
Created November 11, 2010 21:02
Nulogy Packmanager gems (2010-11-11)
actionmailer (2.3.4)
actionpack (2.3.4)
activerecord (2.3.4)
activeresource (2.3.4)
activesupport (2.3.4)
authlogic (2.0.11)
autocomplete_for (0.1.0)
aws-s3 (0.4.0)
barby (0.4.0)
bcrypt-ruby (2.1.2)
sskirby@Resartus:[system]:~/src/hydra$ rake test TEST=test/ssh_test.rb
(in /home/sskirby/src/hydra)
[WARNING] The git gem requires git 1.6.0.0 or later, but only found 1.5.4.3. You should probably upgrade.
All dependencies seem to be installed.
/usr/bin/ruby1.8 -I"lib:lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/ssh_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
/home/sskirby/src/hydra/test
establishing connection
connection established