FILE = File.join(File.dirname(__FILE__), '..', 'activity_exercise_sport.csv') WEIGHTS = [130, 155, 180, 205] ...
Ruby CSV to hash
perl -le'*{$#_}=sub{world},s;"*;$,=$";e,*{$"}=sub{Hello},print$_--->(),&$_'
Perl Hello world!
by Simon Law,
March 18, 2008 13:49,
3 refactorings, tagged with perl, one-liner, obfuscated, hello world
Can you refactor this to ma...
#!/usr/bin/env ruby
files = ARGV.collect { |fname| File.new(fname, 'w') }
...
Ruby Randomly split input lines.
by Scott Robinson,
November 15, 2007 08:56,
2 refactorings, tagged with functional, short, oneliner, one-liner
My first Ruby script. I'm c...
The part where weight_calor...