Skip to content

Instantly share code, notes, and snippets.

View yolk's full-sized avatar

Sebastian Munz yolk

View GitHub Profile
if defined?(Unicorn)
class Unicorn::HttpRequest
alias _read read
undef_method :read
def read(socket)
_read(socket)
REQ.update('HTTP_X_REQUEST_START' => "t=#{((Time.now.to_f) * 1e6).to_i.to_s}")
end
end
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.