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@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
@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
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 / 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 / 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 / .vimrc
Created May 7, 2012 20:44
.vimrc
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
set nocompatible
set hlsearch
set number
set tabstop=2
set shiftwidth=2
@sskirby
sskirby / functions.vim
Created May 7, 2012 20:45
Useful vim functions
vnoremap <leader>re :call ExtractVariable()<cr>
function! ExtractVariable()
let name = input("Variable name: ")
if name == ''
return
endif
normal! gv
exec "normal c" . name
exec "normal! O" . name . " = "
normal! $p
@sskirby
sskirby / .zshrc
Created May 7, 2012 20:47
.zshrc
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="bira"
# Set to this to use case-sensitive completion
@sskirby
sskirby / .ctags
Created May 24, 2012 23:06
.ctags
--regex-ruby=/(^|[:;])[ \t]*([A-Z][[:alnum:]_]+) *=/\2/c,class,constant/
--regex-ruby=/(^|;)[ \t]*(has_many|belongs_to|has_one|has_and_belongs_to_many)\(? *:([[:alnum:]_]+)/\3/f,function,association/
--regex-ruby=/(^|;)[ \t]*(named_)?scope\(? *:([[:alnum:]_]+)/\3/f,function,named_scope/
--regex-ruby=/(^|;)[ \t]*expose\(? *:([[:alnum:]_]+)/\2/f,function,exposure/
--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2/f,function,aasm_event/
--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2!/f,function,aasm_event/
--regex-ruby=/(^|;)[ \t]*event\(? *:([[:alnum:]_]+)/\2?/f,function,aasm_event/
--langdef=js
--langmap=js:.js
@sskirby
sskirby / gear_test.rb
Last active December 18, 2015 04:39
testing outbound query methods - original
class GearTest < MiniTest::Unit:TestCase
def test_calculates_gear_inches
gear = Gear.new(
chainring: 52,
cog: 11,
wheel: Wheel.new(26, 1.5))
assert_in_delta(137.1,
gear.gear_inches,
0.01)
end