Skip to content

Instantly share code, notes, and snippets.

View ohammersmith's full-sized avatar

Otto Hammersmith ohammersmith

View GitHub Profile
IRC
========
Install Notes
-------------
1. server (ie. irc.freenode.net)
2. port is normally 6667 / 9999 for ssl
3. the room field can support multiple rooms (comma separated)
4. the password field is for the server password
When /^I fill in the country for the degree with "(.*)"$/ do |value|
within("#degrees") do
fill_in("Country", value)
end
end
<% if ENV["RAILS_ENV"] == "development" %>
<div id="debug">
<a href="#" onclick="Element.toggle('params_debug_info'); return false">params</a> | <a href="#" onclick="Element.toggle('session_debug_info'); return false">sessions</a>
<fieldset id="params_debug_info" class="debug_info" style="display:none">
<legend>params</legend> <%= debug(params) %>
</fieldset>
<fieldset id="session_debug_info" class="debug_info" style="display:none">
#!/usr/bin/env ruby
class Demo
def initialize(n)
@secret = n
end
def getBinding
return binding()
end
end
{:country=>"United States", :state=>"Delaware", :keyword_filters_attributes=>{"new_1"=>{:any=>true, :keywords=>"Lorem ipsum dolor sit amet,", :must_have=>false, :weight=>4}, "new_2"=>{:any=>true, :keywords=>"Lorem ipsum dolor sit amet,", :must_have=>false, :weight=>8}}, :city=>"Rotorua", :range=>nil, :postal_code=>"03887"}
@ohammersmith
ohammersmith / 25things.rb
Created February 2, 2009 01:45
Annoy your facebook friends right back!
#!/usr/bin/env ruby
# You know that Facebook - fuck I don't know what to call it - you write a note with 25 things about yourself and then
# tag^H^H^Hannoy your friends to do it too. Here's the thing about the power of the network effect... you get annoyed
# a lot.
#
# This is my solution.
#
# Feel free to pick either the plain old random or the rot13(plain old random) version
% script/generate model GrandParent name:string
exists app/models/
exists test/unit/
exists test/fixtures/
create app/models/grand_parent.rb
create test/unit/grand_parent_test.rb
create test/fixtures/grand_parents.yml
create db/migrate
create db/migrate/20090127182616_create_grand_parents.rb
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby /Users/otto/Desktop/Incubator/Protopipe/protopipe/vendor/plugins/rspec/bin/spec spec/controllers/criteria_controller_spec.rb -O spec/spec.opts
...F...F......F....F.....
1)
'CriteriaController GET 'edit' should render a 404 if the specified criterion doesn't exist' FAILED
expected "/Users/otto/Desktop/Incubator/Protopipe/protopipe/public/404.html", got "criteria/edit.html.erb"
./spec/controllers/criteria_controller_spec.rb:227:
2)
NoMethodError in 'CriteriaController PUT 'update' should render a 404 if the specified criterion doesn't exist'
#!/usr/bin/env ruby
# Taken from http://www.napcsweb.com/blog/2008/04/24/create-a-new-edge-rails-project/
git_repo = "git://github.com/rails/rails.git"
help = %Q{
Rails Info:
-v, --version Show the Rails version number and quit.
-h, --help Show this help message and quit.
DELIMITER $
drop FUNCTION if exists tFunc
$
drop PROCEDURE if exists tProc
$