I hereby claim:
- I am mtkd on github.
- I am mtkd (https://keybase.io/mtkd) on keybase.
- I have a public key whose fingerprint is 3B14 B113 0FDD 8519 4F62 3356 C531 D614 ABF8 DE15
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# without new_record set it silently doesn't save | |
new_document = Marshal.load(Marshal.dump(self)) | |
new_document._id = Moped::BSON::ObjectId.new | |
new_document.new_record = true | |
new_document.save |
# Test to see how much time checking super defined costs (approx 10%) | |
require 'benchmark' | |
class Base | |
def meth; end | |
end | |
class WithSuperCheck < Base | |
def meth; super if defined?(super); end |
Friday | |
09.00 Keynote - Marcel Molina | |
10.00 Getting Git - Scott Chacon | |
10.45 Break | |
11.00 Building Blocks of Modularity - Jim Weirich | |
11.45 Break | |
12.00 Merb - Yehuda Katz | |
13.00 Lunch | |
14.30 Cannelloni Beats Spaghetti - Bruce Scharlau |
puts I18n.public_methods.grep(/method/) | |
puts "\n\I18n.methods : "+ I18n.methods.sort.join("\n").to_s+"\n\n" |
git fetch origin other_branch:other_branch | |
* [new branch] other_branch -> other_branch | |
git branch | |
* master | |
other_branch | |
git checkout other_branch |
# command prompt | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;36m\]" | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local GREEN="\[\033[0;32m\]" |
# Monkey patch to add 3 decimal places to code/test ratio | |
# Add to rakefile | |
Rake::TaskManager.class_eval do | |
def remove_task(task_name) | |
@tasks.delete(task_name.to_s) | |
end | |
end | |
def remove_task(task_name) | |
Rake.application.remove_task(task_name) |
09.00 Keynote | |
10.30 Denormalizing Your Rails Application | |
11.30 I Think I Finally Understand Mocks | |
12.30 Getting the most out of ActiveRecord 3 with Arel | |
14.15 Taking the next step in Web Development with Document Databases | |
15.30 Rack Middleware Goodies | |
16.30 Distributed Architectures with Rack | |
09.00 Keynote | |
10.30 RTW (Real Time Web): WTF (What's That For)? |
ndrop = v.length/10 | |
nkeep = v.length - 2*ndrop | |
trunc_mean = v.sort[ndrop,nkeep].sum/(1.0*nkeep) |