This gist is an implementation of http://sirile.github.io/2015/05/18/using-haproxy-and-consul-for-dynamic-service-discovery-on-docker.html on top of Docker Machine and Docker Swarm.
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
| # unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| # 16 workers and 1 master | |
| worker_processes (rails_env == 'production' ? 16 : 4) | |
| # Load rails+github.git into the master before forking workers | |
| # for super-fast worker spawn times | |
| preload_app true |
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
| source :rubygems | |
| gem 'pry' | |
| gem 'capybara' | |
| gem 'capybara-webkit' | |
| gem 'celluloid' |
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 | |
| # From: http://ngauthier.com/2014/06/scraping-the-web-with-ruby.html | |
| require 'capybara' | |
| require 'capybara/poltergeist' | |
| require 'csv' | |
| require 'gdbm' | |
| class NickBot | |
| include Capybara::DSL |
Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from GitHub remotes:
git pr 4- creates local branch pr/4 from theoriginremote and checks it outgit pr 4 upstream- creates local branch pr/4 fromupstreamremote and checks it out
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 :db do | |
| require "sequel" | |
| Sequel.extension :migration | |
| DB = Sequel.connect(ENV['DATABASE_URL']) | |
| desc "Prints current schema version" | |
| task :version do | |
| version = if DB.tables.include?(:schema_info) | |
| DB[:schema_info].first[:version] | |
| end || 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
| require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") | |
| require 'adhearsion' | |
| require 'adhearsion/initializer/asterisk' | |
| require 'drb' | |
| # http://help.cloudvox.com/faqs/getting-started/setup-for-ruby-adhearsion | |
| desc "Make an outgoing phone call to number provided as 'call' (via Cloudvox)" | |
| task :make_outgoing_call do | |
| if ENV['call'] | |
| # Outgoing context from Cloudvox Switchboard, under "Outgoing settings (AMI)." |
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
| fs = require 'fs' | |
| webpage = require 'webpage' | |
| page = webpage.create() | |
| renderedUrls = 0 | |
| totalUrls = 0 | |
| # Taken from https://github.com/ariya/phantomjs/blob/master/examples/waitfor.js | |
| # Converted into coffee | |
| waitFor = (testFx, onReady, timeOutMillis) -> | |
| maxtimeOutMillis = (if timeOutMillis then timeOutMillis else 5000) #< Default Max Timout is 3s |
This Gist is similar to https://gist.github.com/noteed/8656989 which uses Open vSwitch instead of Tinc.
Download the install.sh script and run it:
> https://gist.githubusercontent.com/noteed/11031504/raw/install.sh
This Gist is similar to https://gist.github.com/noteed/8656989 which uses Open vSwitch instead of Tinc.
Download the install.sh script and run it:
> https://gist.githubusercontent.com/noteed/11031504/raw/install.sh