Skip to content

Instantly share code, notes, and snippets.

~/src/cap-resq-test (master)⚡ ➔ rails c
Loading development environment (Rails 3.2.13)
irb(main):001:0> Resque.new
NoMethodError: undefined method `new' for Resque Client connected to redis://127.0.0.1:6379/0:Module
from (irb):1
from /Users/sshingler/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/c
onsole.rb:47:in `start'
from /Users/sshingler/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands/c
onsole.rb:8:in `start'
from /Users/sshingler/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/railties-3.2.13/lib/rails/commands.r
~/src/express-coffee 3 (master) ➔ npm ls
npm WARN unmet dependency /Users/sshingler/src/express-coffee/node_modules/docco-husky requires coffee-script@'latest' but will load
npm WARN unmet dependency /Users/sshingler/src/express-coffee/node_modules/coffee-script,
npm WARN unmet dependency which is version 1.4.0
express-coffee@0.1.6 /Users/sshingler/src/express-coffee
├── coffee-script@1.4.0 invalid
├─┬ connect-assets@2.3.3
│ ├── connect-file-cache@0.2.4
│ ├── mime@1.2.2
│ ├─┬ snockets@1.3.8
require 'rspec'
class MyEnums
def my_map(arr)
result = []
arr.each{|a| result << a*2}
result
end
end
@9z0b3t1c
9z0b3t1c / gist:2479777
Created April 24, 2012 13:45
Clean up git branches
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch
git remote prune origin
# Remove local fully merged branches
git branch --merged master | grep -v master | grep -v am-test | grep -v production | xargs git branch -d
bin/cucumber --require features/ features/example-script.feature
Feature: Google
In order to test a remote site
I surf to google
And take a look
Scenario: Trying Google
When I go to the homepage
And I fill in "Aslak Hellesoy" for the field named "q"
And I press "Google Search"
Then I should see "So little to do - so much time"
@9z0b3t1c
9z0b3t1c / env.rb
Created June 16, 2009 15:22
Webrat Cucumber Mechanize steps to test google
require 'webrat'
require 'webrat/mechanize'
include Webrat::Methods
include Webrat::Matchers
Webrat.configure do |config|
config.mode = :mechanize
end