Skip to content

Instantly share code, notes, and snippets.

class Generation < Struct.new(:members)
def to_a
members
end
def sort
members.sort! do |a,b|
a.score <=> b.score
end
self
raptor(1m|master) $ find ./lib -name "*.rb" -print | xargs wc -l
33 ./lib/raptor/delegation.rb
67 ./lib/raptor/inference.rb
85 ./lib/raptor/responders.rb
206 ./lib/raptor/router.rb
17 ./lib/raptor/shorty.rb
86 ./lib/raptor.rb
494 total
raptor(1m|master) $ git log | wc -l
195
pc-3-97:raptor-perf(326m|master) $ script/statistics master "master^" > stats.csv
=> git rev-list --reverse master..master^
=> git checkout --quiet master^
OK for all revisions!
pc-3-97:raptor-perf(338m|master~1?) $ cat stats.csv
Hash,XXX Count,Require Time,Prod Lines,Spec Lines,Spec Count,Spec Runtime,Spec End-to-End
As ruby developers, we (mostly) aspire to early and continuous delivery of valuable software.This hands-on workshop will test how well you can meet that goal by challenging you to code a simple robot that will have to compete in a series of battles.
You can continue to refine and upgrade your robot though the tournament. The earlier you release your robot, the sooner you will win some battles and start accruing points.
@tcrayford
tcrayford / gist:1576350
Created January 7, 2012 22:48
getting cabal/ghc working on heroku
#!/bin/sh
# Run this on an empty Heroku app:
# heroku create -s cedar my-haskell
# heroku run bash --app my-haskell
curl ftp://ftp.gmplib.org/pub/gmp-5.0.2/gmp-5.0.2.tar.bz2 | tar -xjvf -
cd gmp-5.0.2
./configure -prefix /app/gmp
make install
{
:current_user => "CurrentUser.current_user"
}
@tcrayford
tcrayford / gist:1646808
Created January 20, 2012 11:22
failbundler
pc-3-97:raptor(8161m|master) $ bundle
ERRRO: Gem bundler is not installed, run `gem install bundler` first.
pc-3-97:raptor(8161m|master) $ gem install bundler
Successfully installed bundler-1.0.21
1 gem installed
Installing ri documentation for bundler-1.0.21...
Installing RDoc documentation for bundler-1.0.21...
pc-3-97:raptor(8161m|master) $ bundle
ERRRO: Gem bundler is not installed, run `gem install bundler` first.
pc-3-97:raptor(8161m|master) $ cd ..
from Quartz import *
import time as time
KEYCODES = {
#q12
#w13
#e14
Isolation vs Rails: More Fastererer Speedy Mk II Edition
There is a vast set of tools and patches to speed up Rails boot time. What happens if, instead of testing inside Rails, we isolate our specs from Rails? What benefits can be gained from isolating our testing? Whilst test execution time is an obvious benefit, there are more subtle nuances to isolation.
#!/bin/bash
# assuming `origin (push)` is a github url,
# this opens the current branch on github's site,
# ready for a pull request
# only works on macs right now (it uses `open`)
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' -e 's/)//' -e 's/(//'
}