hide do
_ _ _
/\ /(_) __| | __| | ___ _ __
/ /_/ / |/ _` |/ _` |/ _ \ '_ \
/ __ /| | (_| | (_| | __/ | | |
\/ /_/ |_|\__,_|\__,_|\___|_| |_|
end
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'resque' | |
HOST = ENV['host'] ? ENV['host'] : '127.0.0.1' | |
PORT = ENV['port'] ? ENV['port'] : '6379' | |
Resque.redis = "#{HOST}:#{PORT}" |
This file contains 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 'parallel' | |
class AcceptanceRunner < MiniTest::Unit | |
def initialize(opts = {}) | |
super() | |
@opts = opts | |
end | |
def _run_suites_in_parallel(suites, type) |
This file contains 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
00 01 * * * /bin/bash --login -c 'cd <your app> && RAILS_ENV=production /usr/bin/env bundle exec rake <your rake>' >> /var/log/<your app>.log 2>&1 |
This file contains 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
SimpleCov.at_exit do | |
percent = SimpleCov.result.covered_percent | |
unless percent == 100.0 | |
puts "Coverage is not at 100% !!!!" | |
Kernel.exit(1) | |
end | |
end |
This file contains 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
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
This file contains 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
function d { | |
did=$(docker run -d precise runsvdir /etc/service) | |
ip=$(docker inspect $did | grep IpAddress | cut -d'"' -f4) | |
nc -z $ip 22 && ssh -oStrictHostKeyChecking=no root@$ip | |
docker kill $did | |
} | |
This file contains 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
Ember.KonamiCode = Ember.Mixin.create({ | |
konami: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65, 13], | |
currentIndex: 0, | |
keyPress: function(event) { | |
this._super(event); | |
var index = this.get('currentIndex'); | |
if (event.keyCode === this.konami[index]) { | |
if (index === 10) { | |
this.success(); | |
} else { |
This file contains 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::Matchers.define :have_json_key do |expected_key| | |
match do |response| | |
@body = MultiJson.load(response.body) | |
result = @body.key?(expected_key.to_s) | |
result &&= @body[expected_key.to_s] == @expected_val if @val_provided | |
result | |
end | |
chain :with_value do |val| |
This file contains 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
Capybara.add_selector :record do | |
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) } | |
match { |record| record.is_a?(ActiveRecord::Base) } | |
end |
OlderNewer