I hereby claim:
- I am grosser on github.
- I am grosser (https://keybase.io/grosser) on keybase.
- I have a public key whose fingerprint is 4435 57FE 9ACF 3D5D 4244 CF05 772C BEFC F3BF D2E5
To claim this, I am signing this object:
Dir["tmp/*.txt"].each do |ip_file| | |
puts "-" * 50 | |
puts ip_file | |
ip = File.basename(ip_file).sub('.txt','') | |
puts "ip #{ip}" | |
puts "result:" | |
puts `cat #{ip_file} | ruby script/patch_dns #{ip}` | |
raise unless $?.success? | |
end |
`rm accounts/*` | |
ips = File.readlines('ips.txt') | |
accounts = File.readlines('accounts.txt') | |
mapping = {} | |
accounts.each_with_index.map do |subdomain, i| | |
ip = ips[i % ips.size].strip | |
mapping[ip] ||= [] | |
mapping[ip] << subdomain.strip |
I hereby claim:
To claim this, I am signing this object:
if Rails::VERSION::MAJOR == 2 | |
ActionController::Base.class_eval do | |
def params_with_nil_fix | |
params = params_without_nil_fix | |
unless params.instance_variable_get(:@nil_fixed) | |
params.instance_variable_set(:@nil_fixed, true) | |
# normal form params cannot include nil/empty hash/empty array, just json/xml | |
deep_munge(params) unless ["application/x-www-form-urlencoded", "multipart/form-data", nil].include?(request.try(:content_type)) | |
end |
rails3 = ENV["BUNDLE_GEMFILE"].to_s.include?("rails3") | |
... | |
if rails3 | |
# make bundler use a different cache dir | |
class << Bundler | |
def app_cache | |
root.join("vendor/cache_rails3") | |
end |
require "dogapi" | |
require "celluloid/autostart" | |
require "singleton" | |
class LazyDog | |
include Celluloid | |
include Singleton | |
def emit_point(*args) | |
client.emit_point(*args) |
def audit(klass, method) | |
klass.class_eval do | |
define_method :"#{method}_with_audit" do |*args| | |
result = nil | |
time = Benchmark.realtime do | |
result = send(:"#{method}_without_audit", *args) | |
end | |
$time ||= {} | |
$time[klass] ||= {} | |
$time[klass][method] ||= 0 |
# For Rails3, Rails.logger sync = false. Unicorn's log detection needs to accomodate this | |
module Unicorn | |
module Util | |
# :stopdoc: | |
def self.is_log?(fp) | |
append_flags = File::WRONLY | File::APPEND | |
! fp.closed? && | |
fp.stat.file? && |
# test | |
if Rails::VERSION::MAJOR == 2 | |
# make integration tests use rack response, so we can test our middlewares | |
# and not only the pure controller response | |
ActionController::Base.class_eval do | |
# this is usually done just-in-time by #process but we need to do it earlier | |
include ActionController::Integration::ControllerCapture | |
# then we hide last_instantiation from #process |
#!/usr/bin/env ruby | |
# Complete rake tasks script for bash | |
# Save it somewhere and then add | |
# complete -C path/to/script -o default rake | |
# to your ~/.bashrc | |
# Xavier Shay (http://rhnh.net), combining work from | |
# Francis Hwang ( http://fhwang.net/ ) - http://fhwang.net/rb/rake-complete.rb | |
# Nicholas Seckar <nseckar@gmail.com> - http://www.webtypes.com/2006/03/31/rake-completion-script-that-handles-namespaces | |
# Saimon Moore <saimon@webtypes.com> |