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 'pivotal-tracker' | |
| TOKEN = 'API_TOKEN' | |
| PROJECT_NUM = -1 | |
| def estimate_to_hours(estimate) | |
| 2 ** estimate | |
| end | |
| PivotalTracker::Client.token = TOKEN |
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
| ls -lh `mdfind -onlyin $HOME -name test.log` |
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
| describe 'outer', :one => { :two => 2 } do | |
| context 'inner1' do | |
| before do | |
| example.metadata[:one][:three] = 3 | |
| end | |
| it 'should have 3' do | |
| example.metadata[:one][:three].should == 3 | |
| 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
| require 'nokogiri' | |
| require 'open-uri' | |
| auth_token = 'AUTH_TOKEN' | |
| site = 'https://ACCOUNT_NAME.airbrake.io/projects/PROJECT_NUMBER' | |
| counts = { | |
| :staging => 0, | |
| :production => 0 | |
| } |
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 FactoryGirlStepHelpers | |
| def convert_human_hash_to_attribute_hash(human_hash, associations = []) | |
| HumanHashToAttributeHash.new(human_hash, associations).attributes | |
| end | |
| class HumanHashToAttributeHash | |
| attr_reader :associations | |
| def initialize(human_hash, associations) | |
| @human_hash = human_hash |
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
| Then /^render the page$/ do | |
| if Capybara.current_driver == Capybara.javascript_driver | |
| file_name = "capybara-webkit-#{Time.new.strftime("%Y%m%d%H%M%S")}#{rand(10**10)}.png" | |
| name = File.join(*[Capybara.save_and_open_page_path, file_name].compact) | |
| page.driver.render name | |
| begin | |
| require "launchy" # could raise LoadError | |
| raise LoadError unless Launchy::Version::MAJOR >= 2 | |
| Launchy.open(name) | |
| rescue LoadError |
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 :assets do | |
| desc 'Update the URIs for assets used in the static pages (e.g. 500.html)' | |
| task :update_static_pages => :environment do | |
| manifest_path = Rails.root.join('public', 'assets', 'manifest.yml') | |
| unless File.exists?(manifest_path.to_s) | |
| raise "Must run assets:precompile first" | |
| end | |
| manifest = YAML.load(manifest_path.read) | |
| %w[404 422 500 504 browser].each do |static_page| | |
| path = Rails.root.join('public', "#{static_page}.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
| import os | |
| import signal | |
| bind = "127.0.0.1:8888" | |
| errorlog = "%s/log/gunicorn.log" % (os.getcwd()) | |
| workers = 4 | |
| keepalive = 5 | |
| preload_app = True | |
| def on_starting(server): |
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
| package main | |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "os" | |
| "text/tabwriter" | |
| "time" | |
| ) |
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
| %w(autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev).each do |pkg| | |
| package pkg | |
| end |
OlderNewer