FILE = File.join(File.dirname(__FILE__), '..', 'activity_exercise_sport.csv')

  WEIGHTS = [130, 155, 180, 205]
...

Ruby CSV to hash

by Chirantan Rajhans, August 24, 2011 04:34, No refactoring, tagged with one-liner, array hash

The part where weight_calor...

18bcc556d7688096bd4daa5d72bd6c32 Talk
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...

6869f98aa6911b0f9f13468ccca24813 Talk
#!/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...

1945ab4cdb87eaf5a5c906fa884c29f1 Talk
curl http://www.cnn.com | perl -ne 'm/>([^<].*?[^>])<\// && print$1."\n"'

Perl Perl one-liner to extract x...

by griflet, November 13, 2007 17:19, 4 refactorings, tagged with xml, perl, oneliner, one-liner, tags, html, xhtml

Hello,
I'm a web-scrapping...

Aae34a7973a8d98e53764a1c89090c55 Talk