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
| profile = Selenium::WebDriver::Firefox::Profile.new | |
| profile.add_extension("/path/to/firebug.xpi") | |
| driver = Selenium::WebDriver.for :firefox, :profile => profile |
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 "mysql_big_table_migration_helper" | |
| class AddIndexOnSomeColumnToSomeTable < ActiveRecord::Migration | |
| extend MySQLBigTableMigrationHelper | |
| def self.up | |
| add_index_using_tmp_table :some_table, :some_column | |
| 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
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
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
| namespace :monitoring do | |
| desc "Query Cloudkick's list of IPs monitoring requests are sent from, then add/remove security group rules as needed" | |
| task :setup_security => :environment do | |
| # Ignore certificate errors | |
| SECURITY_GROUP_NAME = 'monitoring' | |
| OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
| @ec2 = AWS::EC2::Base.new( |
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
| # Full credit to: http://jeffmiller.github.com/2011/01/10/ssh-host-color | |
| #!/bin/bash | |
| # | |
| # ssh into a machine and automatically set the background | |
| # color of Mac OS X Terminal depending on the hostname. | |
| # | |
| # Installation: | |
| # 1. Save this script to /some/bin/ssh-host-color | |
| # 2. chmod 755 /some/bin/ssh-host-color |
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/sh | |
| [ -f /etc/apt/apt.conf.d/01apt-cacher-ng-proxy ] || echo "Acquire::http { Proxy 'http://10.0.2.2:3142'; };" > /etc/apt/apt.conf.d/01apt-cacher-ng-proxy |
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
| # WAIT! Do consider that `wait` may not be needed. This article describes | |
| # that reasoning. Please read it and make informed decisions. | |
| # https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path |
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
| # in features/support/env.rb | |
| require 'selenium/webdriver' | |
| # we need a firefox extension to start intercepting javascript errors before the page | |
| # scripts load | |
| Capybara.register_driver :selenium do |app| | |
| profile = Selenium::WebDriver::Firefox::Profile.new | |
| # see https://github.com/mguillem/JSErrorCollector | |
| profile.add_extension File.join(Rails.root, "features/support/extensions/JSErrorCollector.xpi") | |
| Capybara::Selenium::Driver.new app, :profile => profile |
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
| ## Knife plugin to set node environment | |
| # See http://wiki.opscode.com/display/chef/Environments | |
| # | |
| ## Install | |
| # Place in .chef/plugins/knife/set_environment.rb | |
| # | |
| ## Usage | |
| # Nick-Stielaus-MacBook-Pro:chef-repo nstielau$ knife node set_environment mynode.net my_env | |
| # Looking for mynode.net | |
| # Setting environment to my_env |
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
| # Knife Configuration File. | |
| # | |
| # This is a Ruby DSL to set configuration parameters for Knife's | |
| # general options. The default location for this file is | |
| # ~/.chef/knife.rb. If multiple Chef repositories are used, | |
| # per-repository configuration files can be created. A per repository | |
| # configuration file must be .chef/knife.rb in the base directory of | |
| # the Chef repository. For example, | |
| # | |
| # ~/Development/chef-repo/.chef/knife.rb |
OlderNewer