Skip to content

Instantly share code, notes, and snippets.

Trying to figure out how to look up comments I've left

Pat Maddox patmaddox

Trying to figure out how to look up comments I've left
View GitHub Profile
View retrieve_keys
[1] pry(main)> hash = {a: 1, b: 2, c: 3}
=> {:a=>1, :b=>2, :c=>3}
[2] pry(main)> class Hash
[2] pry(main)* def retrieve_keys(*keys)
[2] pry(main)* self.reduce({}) { |h, (k, v)|
[2] pry(main)* keys.include?(k) ? h.merge!({k => v}) : h
[2] pry(main)* }
[2] pry(main)* end
[2] pry(main)* end
=> nil
patmaddox /
Created May 9, 2012 — forked from karlstolley/
Computer Prep Instructions for End-to-End Agile Web Application Development from Basically Nothing

The workshop will require a number of technologies, which time will not permit us to set up on site. So, find your operating system below (Windows or Mac; if you're on Linux, let me know), and follow the steps to get your computer set up ahead of time. If you have any problems, email

At the request of some participants, I've also provided links to some reading material at the very bottom of this page. Look through that stuff if you have the time or interest.

You can find more detailed installation instructions at and a curriculum for building and deploying a rails application from the ground up at


First, you'll want to have a good editor on hand for the workshop. You can't do much better than Notepad++; just download and unzip this file: Unzip the file; there will be

View gist:144009
# done
# -- Matthew Peychich
Factory.define :venue do |v| 'Foo Place'
v.url {}
v.address_hint 'MyString' '(805) 555-1212'
v.capacity 'MyString' ''
v.image 'MyString'
View protocol.rb
class RestfulReader
def get(things)
# GET funky restafarian
alias_method :fetch, :get
class SqlReader
def select(things)
# I hate SQL
View strange_name_error.rb
# When I run the specs above, the following error occurs:
$ script/spec -c spec/controllers/strange_name_error.rb
./spec/controllers/strange_name_error.rb:15: undefined local variable or method `properties_url' for #<Class:0x22b918c> (NameError)
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `module_eval'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:68:in `create_nested_example_group'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `instance_eval'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/extensions/class.rb:14:in `subclass'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:66:in `create_nested_example_group'
from /Users/nick/src/housing-rentals/vendor/plugins/rspec/lib/spec/example/example_group_methods.rb:53:in `describe'
You can’t perform that action at this time.