This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://henrik.nyh.se/2008/12/git-dirty-prompt | |
| # http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
| # username@Machine ~/dev/dir[master]$ # clean working directory | |
| # username@Machine ~/dev/dir[master*]$ # dirty working directory | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
| } | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Taken from the image_science gem. | |
| require 'rubygems' | |
| require 'test/unit/testcase' | |
| require 'test/unit' if $0 == __FILE__ | |
| require 'image_science' | |
| class TestImageScience < Test::Unit::TestCase | |
| def deny x; assert ! x; end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| goto endofruby | |
| #!/bin/ruby | |
| 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. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DELIMITER $ | |
| drop FUNCTION if exists tFunc | |
| $ | |
| drop PROCEDURE if exists tProc | |
| $ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % 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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {: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"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class Demo | |
| def initialize(n) | |
| @secret = n | |
| end | |
| def getBinding | |
| return binding() | |
| end | |
| end |