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
| // Place this in your bootstrap file before dispatching your front controller | |
| $writer = new Zend_Log_Writer_Firebug(); | |
| $logger = new Zend_Log($writer); | |
| // Use this in your model, view and controller files | |
| $logger->log('This is a log message!', Zend_Log::INFO); |
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
| rand(36**length).to_s(36) |
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 "net/https" | |
| require "uri" | |
| uri = URI.parse('https://repo.dev.bbc.co.uk') | |
| pem = File.read("../../keys/combine.pem") | |
| #http = Net::HTTP::Proxy('www-cache.reith.bbc.co.uk', 80).new(uri.host, uri.port) | |
| http = Net::HTTP.new(uri.host, uri.port) | |
| http.use_ssl = true | |
| http.cert = OpenSSL::X509::Certificate.new(pem) | |
| http.key = OpenSSL::PKey::RSA.new(pem) |
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 'singleton' | |
| class MySingleton | |
| include Singleton | |
| attr_accessor :myvar | |
| def initialize | |
| puts 'output from initialize in a singleton!' | |
| end | |
| 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
| [core] | |
| editor = "mvim -f -c 'au VimLeave * !open -a Terminal'" | |
| [merge] | |
| tool = vimdiff | |
| guitool = mvim | |
| [diff] | |
| tool = vimdiff | |
| guitool = mvim | |
| [mergetool "mvim"] | |
| cmd = mvim -f -d "$LOCAL" "$MERGED" "$REMOTE" |
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 end the debugging session and return control to the app: | |
| quit | |
| To find out where you are: | |
| where | |
| Note, this will print out a stack trace only if you’ve added the Debugger.start as specified above. If you haven’t, where will only print out the line number and file name of where execution has reached. | |
| To see where you are in context (current line with a few lines before and after): | |
| list |
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
| #Access Scenario Metadata | |
| Before do |scenario| | |
| p scenario.source_tag_names | |
| 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
| # Add this to more_web_steps.rb | |
| # Selenium docs: http://code.google.com/p/selenium/wiki/RubyBindings#Javascript_Alert/Confirm today! | |
| When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text| | |
| alert = page.driver.browser.switch_to.alert | |
| alert.text.should eq(text) | |
| alert.send(action) | |
| 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
| To use a local packaged gem file: | |
| 1. Manually create vendor/cache | |
| 2. Add your .gem file to this directory | |
| 3. ALWAYS run bundle install with --no-cache option....all other gems will then be obtained from remote source | |
| Note: when using :path, this can only be to a directory containing a .gemspec 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
| When /^I go to google$/ do | |
| p page.driver.agent.request_headers = {'Accept-Language' => 'en-gb'} | |
| visit('http://localhost:7001') | |
| end | |
| Then /^I should see the title google$/ do | |
| find('title').text.should == 'RubyGems Documentation Index' | |
| end |