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
| Sequel.connect(:adapter => 'oracle', :user => 'something', :password => 'secret', :database => '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<somehost>)(PORT=<someport>))(CONNECT_DATA=(SID=<somesid>)))') |
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
| public class ObjectComparer : System.Collections.IComparer | |
| { | |
| private const int COMPARE_EQUAL = 0; | |
| private const int COMPARE_GREATERTHAN = 1; | |
| private const int COMPARE_LESSTHAN = -1; | |
| private string _propertyNames = string.Empty; | |
| //params string[] names | |
| public ObjectComparer(string propertyName){ | |
| this._propertyNames = propertyName; | |
| } |
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
| module Capistrano | |
| class SSH | |
| class << self | |
| alias :original_connect :connect | |
| def connect(server, options={}, &block) | |
| special_server_settings = options[:server_authentication] ? options[:server_authentication][server.to_s] : nil | |
| if special_server_settings.nil? | |
| return original_connect(server, options, &block) | |
| else | |
| methods = [ %w(publickey hostbased), %w(password keyboard-interactive) ] |
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
| map.resource :people |
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
| india:mymckinsey mdeiters$ rake deadweight | |
| (in /Users/mdeiters/development/mckinsey/mymckinsey) | |
| /stylesheets/application.css | |
| /stylesheets/facebox.css | |
| /stylesheets/IE6.css | |
| /stylesheets/IE7.css | |
| / | |
| /networks | |
| /profiles/14714-sean-brown | |
| /profiles/14714-sean-brown/friendships |
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
| india:mymckinsey mdeiters$ rake deadweight | |
| (in /Users/mdeiters/development/mckinsey/mymckinsey) | |
| /stylesheets/application.css | |
| /stylesheets/facebox.css | |
| /stylesheets/IE6.css | |
| /stylesheets/IE7.css | |
| / | |
| /networks | |
| /profiles/14714-sean-brown | |
| /profiles/14714-sean-brown/friendships |
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
| require 'rubygems' | |
| require 'active_record' | |
| require 'spec' | |
| ActiveRecord::Base.establish_connection( { | |
| :adapter => 'mysql', | |
| :host => 'localhost', | |
| :database => 'testbed', | |
| :username => 'root', | |
| :password => '' |
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
| #TO RUN | |
| # Install ruby | |
| # from command line type gem install sinatra haml | |
| # create this file and call it app.rb | |
| # from command line type ruby app.rb | |
| # open up browser to http://localhost:4567/haml | |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'haml' |
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
| require 'rubygems' | |
| require 'open-uri' | |
| require 'hpricot' | |
| doc = Hpricot(open("http://en.oreilly.com/rails2009/public/schedule/topic/General")) | |
| doc.search('.url').each do |session| | |
| session_link = "http://en.oreilly.com#{session[:href]}" | |
| session_page = Hpricot(open(session_link)) | |
| begin | |
| title = session_page.at('.summary').inner_html | |
| rating = session_page.at('.en_grade_average_detail').inner_html |
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
| class Show | |
| has_many :scenes | |
| end | |
| class Scene | |
| has_one :scenable :as => :scenable | |
| end | |
| class Announcement | |
| belongs_to :scenable, :polymorphic => true |