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
use master | |
drop database activerecord_unittest | |
drop database activerecord_unittest2 | |
go | |
create database activerecord_unittest | |
go | |
create database activerecord_unittest2 | |
go | |
use activerecord_unittest | |
go |
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 'spec/runner/formatter/base_text_formatter' | |
require 'progressbar' | |
module Spec | |
module Runner | |
module Formatter | |
class CompactProgressBarFormatter < BaseTextFormatter | |
# Threshold for slow specs, in seconds. | |
# Anything that takes longer than this will be printed out | |
THRESHOLD = 0.25 |
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
# I didn't like the original for two reasons: | |
# 1) joining strings into a regex with "|" smells like a future bug to me | |
# (unless you will never match on anything containing '|') | |
# 2) always using regex smells to me. why not leave that decision to the | |
# user of this method? I offer two alternatives, based on === and ==. | |
# 3) this might be premature optimization, but I've skipped the map step | |
# to save memory and time in calling methods that may not be used. | |
# true if any fields of this object match any of the values | |
# (implicitly converting values to case insensitive Regexp, as in original) |
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
Works with cucumber 0.3.104. Earlier versions of | |
cucumber use a slightly different formatter API, | |
and will require small tweaks to make this work. |
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
cd ~/tmp | |
# current bundler (0.6.0) has a different bug, so I'm using github master version | |
git clone git://github.com/wycats/bundler | |
cd bundler | |
git rev-parse HEAD # => 4907696811a73211aaded4f6ba03cbc45898769b | |
rake install | |
cd .. | |
rails test_gem_bundler |
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
Why is rvm re-ordering my $PATH? | |
I can understand it placing its own dirs | |
on the front of the path... but why have | |
items 1-7 been shuffled below items 8-13? | |
(And no, I don't know why the /opt/local | |
dirs are there both with and without the | |
trailing slash. I'll clean that up.) |
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
class Array | |
def permute | |
return Array(first).map {|e| [e] } if length == 1 | |
Array(first).inject([]) {|a,e| | |
Array(self[1..-1]).permute.each {|p| | |
a << [e] + p | |
} | |
a | |
} | |
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
source :rubygems | |
gem "vegas", "~> 0.1.4" | |
gem "rack", "~> 1.1.0" | |
gem "mongrel", "~> 1.1.5" |
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
mount | | |
awk '/ext3/{ print $3 }' | | |
grep -v '/tmp' | | |
xargs df | | |
awk 'NR==1{next} | |
$4~/%/{ print "+ "$2" ("$5")"; SUM += $2 } | |
$5~/%/{ print "+ "$3" ("$6")"; SUM += $3 } | |
END { print "=> " SUM/1024/1024 }' |
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
sudo last -i -f /var/log/btmp | | |
awk '{ per[$3] += 1 } END { for (i in per) print per[i], i }' | | |
sort -n | | |
tail -15 |
OlderNewer