Skip to content

Instantly share code, notes, and snippets.

@timtyrrell
timtyrrell / voices
Created April 29, 2011 20:35 — forked from djohnsonjr/voices
Hear all of the voices on the mac from IRB
# drop in irb
voices = ["Agnes", "Kathy", "Princess", "Vicki", "Victoria", "Bruce", "Fred",
"Junior", "Ralph", "Albert", "Bad News", "Bahh", "Bells", "Boing", "Bubbles",
"Cellos", "Deranged", "Good News", "Hysterical", "Pipe Organ", "Trinoids", "Whisper", "Zarvox"]
statement = "balls"
voices.each do |v|
`say -v #{v} #{statement}`
@timtyrrell
timtyrrell / gist:1067936
Created July 6, 2011 18:18
a rspec example
describe Order do
context "after create" do
before(:each) do
@order = Order.new
@order.customer.confirmed = confirmed
@order.save!
end
context "when customer is confirmed" do
it "should be delivered" do
@timtyrrell
timtyrrell / gist:1746014
Created February 5, 2012 15:12
vim naviation
" simplify split navigation
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
@timtyrrell
timtyrrell / gist:1746671
Created February 5, 2012 17:19
ctags excludes example
map <Leader>rt :!ctags --exclude=app/assets/javascripts/ckeditor/* --exclude=app/assets/javascripts/jquery* --exclude=app/assets/javascripts/chosen* --exclude=app/assets/javascripts/spell/* --exclude=app/assets/javascripts/raphael.js --exclude=.git --exclude=log --tmp --extra=+f -R *
@timtyrrell
timtyrrell / gist:1903287
Created February 24, 2012 19:52
1.9.3 ruby debug install
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
gem install linecache19-0.5.13.gem
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0
OR if Falcon the last one is use the one below (or whatever)
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=$HOME/.rvm/src/ruby-1.9.3-p0-falcon
@timtyrrell
timtyrrell / stuff
Created March 3, 2012 02:00
Kill notifiers
****On Start****
do shell script "killall YoruFukurou"
do shell script "killall Mail"
do shell script "killall 'Google Notifier'"
****On End****
tell application "Mail"
@timtyrrell
timtyrrell / faker_stuff.rb
Created August 24, 2012 20:34
Faker defining sequences for FactoryGirl
# spec/support/sequences.rb
FactoryGirl.define do
sequence(:username) { |n| Faker::Internet.user_name + "-#{n}" }
sequence(:first_name) { Faker::Name.first_name }
sequence(:last_name) { Faker::Name.last_name }
sequence(:name) { |n| "#{Faker::Lorem.sentence}-#{n}" }
#etc
end
#spec/factories/example_stuff.rb
@timtyrrell
timtyrrell / .vimrc
Created August 28, 2012 14:35
command-t
" Command-T configuration
let g:CommandTMaxHeight=20
let g:CommandTMatchWindowAtTop = 1
map <leader>tv :CommandTFlush<cr>\|:CommandT app/views<cr>
map <leader>tc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
map <leader>tm :CommandTFlush<cr>\|:CommandT app/models<cr>
map <leader>th :CommandTFlush<cr>\|:CommandT app/helpers<cr>
map <leader>tl :CommandTFlush<cr>\|:CommandT lib<cr>
map <leader>tp :CommandTFlush<cr>\|:CommandT public<cr>
map <leader>ts :CommandTFlush<cr>\|:CommandT spec<cr>
@timtyrrell
timtyrrell / .vimrc
Created August 28, 2012 14:35
command-t
" Command-T configuration
let g:CommandTMaxHeight=20
let g:CommandTMatchWindowAtTop = 1
map <leader>tv :CommandTFlush<cr>\|:CommandT app/views<cr>
map <leader>tc :CommandTFlush<cr>\|:CommandT app/controllers<cr>
map <leader>tm :CommandTFlush<cr>\|:CommandT app/models<cr>
map <leader>th :CommandTFlush<cr>\|:CommandT app/helpers<cr>
map <leader>tl :CommandTFlush<cr>\|:CommandT lib<cr>
map <leader>tp :CommandTFlush<cr>\|:CommandT public<cr>
map <leader>ts :CommandTFlush<cr>\|:CommandT spec<cr>
@timtyrrell
timtyrrell / .vimrc
Last active December 11, 2015 17:48
My vim tab navigation
" vim tab navigation
nnoremap th :tabfirst<CR>
nnoremap tj :tabnext<CR>
nnoremap tk :tabprev<CR>
nnoremap tl :tablast<CR>
nnoremap td :tabclose<CR>
nnoremap tn :tabnew<CR>