Skip to content

Instantly share code, notes, and snippets.

@Evangenieur
Evangenieur / global_constant.rb
Created August 23, 2011 16:11
Resolve CONSTANT in instance_eval & Import CONSTANT from Module / Class
module GlobalConstant
AUTORESOLVE = []
AUTOIMPORT = []
def self.install
Object.instance_eval do
class << self
alias old_const_missing const_missing
def const_missing constant
to_check = GlobalConstant::AUTORESOLVE.keep_if { |m| m.singleton_class == self } + GlobalConstant::AUTOIMPORT
@Evangenieur
Evangenieur / Readme.md
Created March 27, 2011 23:30 — forked from grosser/Readme.md
Ruby Server / Node.js Benchmark

Sinatra

ruby 1.9.2 + async_sinatra + thin thin start

ab -n 10000 -c 100 http://localhost:3000/
-> 49ms / request

Node

node server.js