Skip to content

Instantly share code, notes, and snippets.

View textgoeshere's full-sized avatar

Dave Nolan textgoeshere

View GitHub Profile
@textgoeshere
textgoeshere / splitter example conf
Created October 4, 2012 13:49
basic nginx conf for continuous experimentation
upstream _a {
server 127.0.0.1:8000;
}
upstream _b {
server 127.0.0.1:8001;
}
upstream _c {
server 127.0.0.1:8002;
### Keybase proof
I hereby claim:
* I am textgoeshere on github.
* I am davenolan (https://keybase.io/davenolan) on keybase.
* I have a public key whose fingerprint is EC9B E6CB F342 5FDE 8036 DA1A 59DD E718 66CF BD01
To claim this, I am signing this object:
require 'rails'
require 'erb'
require 'net/http'
module Secret; def self.get; end; end
def redirect_to(*args); end
secret_key_base = '1b48b72008d5d7a0e23f49a77daf5d283d07335c586b29f38eca240067257d585d2f87ee4eff888b77c3bc759bbe7934564f27dba50a12114881ed31c9a6da1e'
escaped_original_cookie = 'dHNjMlM0KzFsODJtUzg2VEY2eS9sYjJONlVvR1VDODdDaVc2MWVmOFk0OFlCaEZRd2xuS08rRmJ5Uy9QQWUzeGNYdGJjSVBIalZ4L0RoNmRwVGx3Z2lSemkyWnFMOW5CWmxmcFBjdFJOOUwwUnFnTjVnTFVOTVFGcEtHbE9oRDZvOVhRcXFaYmwzQmdjaW9LdWJEYlVuRXQ0OXdTK3l6a3YzcmJPTld1WGlVdHNUME5pRE1HVGZwTDJ3TmNyd3VFWHNqZ2RVV0hxREtXUno3eStYSmJhVjEzZlZqcXhNK293WUg5U0dqWVdTZHJoTWx0S0JZSHVMa0RhSUxQMXI4WUNzY1I0RmFHbEV4VGpFU2V5Vnh1dU55eHowOWVaR2hERmJ1U2xwdWZRZlBtR0w2cUxVZ3d0V1krWjdlUXJKdjJibndOallFcVRXSmV2QVhhdnFtcWU3RS94Rm5aK3VuZUZIUWxXRHlZaHhPMmlBQ2NKeTRPcSs0RGMzdjdieWUrQ1U1MWVVNTA4Smg5VzlkMk43cm92Sm1UUkc3VHAyZUFVSFMwU0xEZ0hTNVFpbldDU3dCRVI1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wxfE0TQ6tjEBx5QA/oAukyvVwmCXEupOd4+rJQtYfPXlbzP7NqDi6gY3RXl67d0i/wnkxk2fzm3Uysb
require 'mechanize'
EMAIL = 'peter.parker@gmail.com'
agent = Mechanize.new
400.times do |i|
puts i
begin
agent.get "http://localhost:3000/users/#{i + 1}/edit"
config.assets.precompile << Proc.new do |path|
full_path = Rails.application.assets.resolve(path).to_path
app_assets_path = Rails.root.join('app', 'assets').to_path
if full_path.starts_with? app_assets_path
if full_path =~ /\.(css|js)\./
puts "\e[0;32m✓ #{full_path}\e[0m"
true
else
puts "\e[1;30m✗ #{full_path}\e[0m"
false
#!/usr/bin/env ruby
require 'open-uri'
require 'timeout'
class Future < BasicObject
def initialize(callable)
@thread ||= ::Thread.new { callable.call }
end
#!/usr/bin/env bash
###############################################################
# Prevents a commit when Gemfile has references to local gems #
###############################################################
if
test "$(git diff-index --cached HEAD -G'\Wpath(:|\s?=\>)' -- Gemfile)"
then
echo "Error: you have references to local gems in your Gemfile. Commit aborted."

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
#
# Example:
#
# 1) Make sure this file is loaded in an initializer
#
# 2) Add the following to your application.rb in Rails3: