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 'yaml' | |
| class Company | |
| attr_accessor :name, :street, :town, :state, :postcode, :phone, :website, :fax, :categories | |
| end | |
| y = File.open( "companies.yaml" ) | |
| counter = 0 | |
| yp = YAML::load_documents( y ) { |doc| |
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
| #!/bin/bash | |
| db_name=$1 | |
| date_time=`date +%Y%m%d_%H%M_%S_` | |
| file_name=${date_time}${db_name}.sql | |
| echo "Dumping the database ${db_name} in ${file_name}..." | |
| mysqldump5 pregnancy_directory_development --user=root > ${file_name} | |
| echo "Sayonara" |
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
| #!/bin/bash | |
| db_name=$1 | |
| date_time=`date +%Y%m%d_%H%M_%S` | |
| file_name=${db_name}_${date_time}.sql | |
| echo "Dumping the database ${db_name} in ${file_name}..." | |
| mysqldump5 ${db_name} --user=root > ${file_name} | |
| echo "Sayonara" |
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
| #!/bin/bash | |
| db_name=$1 | |
| db_dump_file=$2 | |
| echo "Dropping the database ${db_name}..." | |
| mysqladmin5 drop ${db_name} --user=root | |
| echo "Creating the database ${db_name}..." | |
| mysqladmin5 create ${db_name} --user=root | |
| echo "Restore structure and data from ${db_dump_file}" |
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
| Recipe.all.each(&:save) | |
| YAML::load( File.open( 'README' ) ) | |
| self.class.helpers.link_to( | |
| include ActionController::UrlWriter |
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' | |
| gem 'soap4r' | |
| require 'soap/wsdlDriver' | |
| wsdl_url = "http://YOU-URL-HERE?wsdl" | |
| driver = SOAP::WSDLDriverFactory.new(wsdl_url).create_rpc_driver | |
| driver.options["protocol.http.basic_auth"] << [wsdl_url, "USER", "PASS"] | |
| response = driver.functionHere(1, 2, 3) |
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 VerboseExpectationsHelpers | |
| def expect_page_has(path, options={}) | |
| @path, @options = path, options | |
| raise Capybara::ElementNotFound, text_found_instead if !page.has_css?(@path, @options) | |
| end | |
| def expect_page_count(path, options={}) | |
| @path, @options = path, options | |
| raise Capybara::ElementNotFound, total_found_instead if !page.has_css?(@path, @options) |
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
| arbon:cos enricoant$ gem install rack -v 1.0.1 | |
| /Users/enricoant/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:254: warning: getc is obsolete; use STDIN.getc instead | |
| ^CERROR: Interrupted | |
| carbon:cos enricoant$ history | grep rack | |
| 135 gem list rack | |
| 139 gem install rack -v 1.0.1 | |
| 145 gem install rack | |
| 146 history | grep rack | |
| 147 gem install rack -v 1.0.1 | |
| 149 gem install rack -v 1.0.1 |
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
| ### Installing rack or rails was failinf when running 1.8.7-p249 via RVM | |
| ### /Users/enricoant/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:254: warning: getc is obsolete; use STDIN.getc instead | |
| ### So i switched to 1.8.7-p248 via RVM | |
| carbon:cos enricoant$ gem install rack -v 1.0.1 | |
| /Users/enricoant/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:254: warning: getc is obsolete; use STDIN.getc instead | |
| ^CERROR: Interrupted | |
| carbon:cos enricoant$ gem install rails | |
| /Users/enricoant/.rvm/rubies/ruby-1.8.7-p248/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:254: warning: getc is obsolete; use STDIN.getc instead |
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
| [color] | |
| branch = auto | |
| diff = auto | |
| status = auto | |
| [color "branch"] | |
| current = yellow reverse | |
| local = yellow | |
| remote = green | |
| [color "diff"] | |
| meta = yellow bold |
OlderNewer