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
puts "export #{vars.map { |k, v| %{#{k}="#{v}"} }.join(" ")}" |
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
failbowl:rubies(master) $ git l | |
* 65cc7ef (41 seconds) <Gary Bernhardt> (HEAD, master) Merge branch 'activate_command_cleanup' | |
|\ | |
| * f4ced72 (2 minutes) <Gary Bernhardt> extract variables | |
| * f2760be (3 minutes) <Gary Bernhardt> File.join instead of string interpolation | |
| * 94b8df5 (5 minutes) <Gary Bernhardt> activate command's imperative part is in activate! | |
|/ | |
* 9291243 (7 minutes) <Gary Bernhardt> Merge branch 'ruby_info_cleanup' | |
|\ | |
| * b7cb944 (9 minutes) <Gary Bernhardt> indentation |
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
#!/usr/bin/env bash | |
main() { | |
if [ ! -p .test-commands ]; then | |
mkfifo .test-commands | |
fi | |
while true; do | |
cmd=$(cat .test-commands) | |
if [[ $cmd == "" ]]; then |
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
bench "paths", :without_gc => true, :gc_time => true do | |
PATHS[0, 1000].each { |choice| Score.score(choice, "x" * 16) } | |
end | |
Output: | |
...!.!.!.!.............................................. | |
filtering paths | |
Before: | --X----------------------- | | |
After: | ---------X-------------------------| |
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
it "requires an amount_charged greater than 0" do | |
order = FactoryGirl.build(:order, :amount_charged => 0) | |
order.valid?.should == false | |
order.errors[:amount_charged].should == ["must be greater than 0"] | |
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
failbowl:selecta(scoring_redesign) $ ruby ../readygo/readygo.rb --compare benchmark.rb | |
.!.!.!.!.!.!.!.!..!.!.!.!.!.!.!.!.!.!...!.!.!.!.!.!.!.!............................................................................................................. | |
filtering non-matching | |
Baseline: | X-----------| | |
Current: | X--------- | | |
0 6.848 ms | |
filtering matching exactly | |
Baseline: | X-------------------| |
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 "erb" | |
require "pathname" | |
DOT_TEMPLATE=<<-END | |
digraph { | |
size="20,20"; | |
overlap=false; | |
sep=0.4; | |
graph [fontname=Helvetica,fontsize=10]; | |
node [fontname=Helvetica,fontsize=10]; |
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
find $(manpath | tr ':' '\n') -iname '*.1' | xargs cat | (LC_CTYPE=C tr -C '[:alnum:]-_' '\n') | egrep '^--[\-_[:alnum:]]+$' | sort | uniq -c | sort -n |
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 RenderToHTML | |
def self.book | |
[title, css, body].join("\n") | |
end | |
private | |
def self.title | |
commit_hash = `git log -1 --pretty="format:%H"` | |
%{ |
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
git diff --name-status head~3000..head | grep '^D' | awk '{print $2}' | while read f; do git log -1 --pretty="format:%H" -- "$f"; done > temp.txt |
OlderNewer