hide do
_ _ _
/\ /(_) __| | __| | ___ _ __
/ /_/ / |/ _` |/ _` |/ _ \ '_ \
/ __ /| | (_| | (_| | __/ | | |
\/ /_/ |_|\__,_|\__,_|\___|_| |_|
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
| #!/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 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 'parallel' | |
| class AcceptanceRunner < MiniTest::Unit | |
| def initialize(opts = {}) | |
| super() | |
| @opts = opts | |
| end | |
| def _run_suites_in_parallel(suites, type) |
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
| 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 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
| 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 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
| 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 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
| 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 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::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 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 'openssl' | |
| ssid = 'Delorean' | |
| passphrase = 'hoverboardsdonotworkonwater' | |
| puts OpenSSL::PKCS5.pbkdf2_hmac_sha1(passphrase, ssid, 4096, 32).unpack("H*").first |
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
| # https://gist.github.com/1214052 | |
| require 'sinatra/base' | |
| class ResqueWeb < Sinatra::Base | |
| require 'resque/server' | |
| use Rack::ShowExceptions | |
| if CFG[:user].present? and CFG[:password].present? | |
| Resque::Server.use Rack::Auth::Basic do |user, password| | |
| user == CFG[:user] && password == CFG[:password] |
OlderNewer