This file contains 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
$ ctags -R --exclude=.git --exclude=log * ~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/* |
This file contains 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 'benchmark' | |
class User | |
def initialize | |
@instance_var = rand(100) | |
end | |
end | |
users = [] | |
10000.times do |i| |
This file contains 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
module Instrument | |
def instrument(method) | |
alias_method "#{method}_old", "#{method}" | |
define_method method do |*args| | |
t = Time.now.to_i | |
send("#{method}_old", *args) | |
result = Time.now.to_f - t | |
p "#{method}: #{result} seconds" | |
end |
This file contains 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
framework "ScriptingBridge" | |
def volume(value) | |
volume = "set volume output volume #{value}" | |
applescript = NSAppleScript.alloc.initWithSource(volume) | |
result = applescript.executeAndReturnError(nil) | |
end | |
volume(0) |
This file contains 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 'rubygems' | |
dm_version = "=1.2.0" | |
gem "dm-core", dm_version | |
require 'dm-core' | |
gem "dm-migrations", dm_version | |
require 'dm-migrations' | |
class Thing |
This file contains 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
def autovivicating_hash | |
Hash.new {|ht,k| ht[k] = autovivicating_hash} | |
end | |
x = autovivicating_hash | |
x["a"]["b"]["c"] = 1 |
This file contains 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 'mongo' | |
m = Mongo::Connection.new | |
db = m['metric_io_development'] | |
db.create_collection('incoming', {:capped => true, :max => 10}) | |
# https://github.com/bcg/em-mongo/blob/master/lib/em-mongo/database.rb#L117 |
This file contains 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
module Goliath | |
module Rack | |
class Logger | |
include Goliath::Rack::AsyncMiddleware | |
def initialize(app) | |
super(app) | |
end | |
def call(env) |
This file contains 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
function! InsertCurrentFile() | |
let filename = expand("%:p") | |
execute "normal a".filename | |
endfunction | |
:call InsertCurrentFile |
This file contains 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
assets.denachtdienst.org/javascripts/james.js?1283993145:152010-09-09 11:25:16 [INFO] [Faye.Client] New client created for "http://denachtdienst.org:8000/faye" | |
assets.denachtdienst.org/javascripts/james.js?1283993145:152010-09-09 11:25:16 [DEBUG] [Faye.Transport] Created new "callback-polling" transport for "http://denachtdienst.org:8000/faye" | |
assets.denachtdienst.org/javascripts/james.js?1283993145:152010-09-09 11:25:16 [INFO] [Faye.Client] Initiating handshake with "http://denachtdienst.org:8000/faye" | |
assets.denachtdienst.org/javascripts/james.js?1283993145:152010-09-09 11:25:16 [DEBUG] [Faye.Transport] Client undefined sending message to "http://denachtdienst.org:8000/faye": [{"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["callback-polling"],"id":"1ginf3l17dssdu1g6u5of1yhkx9i"}] | |
assets.denachtdienst.org/javascripts/james.js?1283993145:152010-09-09 11:25:16 [DEBUG] [Faye.Transport] Client undefined received from "http://denachtdienst.org:8000/faye": [{"id":"1ginf3l17dssdu1g6u5of1yh |