Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created December 3, 2014 08:31
Show Gist options
  • Save jc00ke/dda801e8390aeedb93c5 to your computer and use it in GitHub Desktop.
Save jc00ke/dda801e8390aeedb93c5 to your computer and use it in GitHub Desktop.
def td(n)
eval(eval('"'+"
".tr(" \t","01").
tap{ |x| puts "tr'd"; puts x; puts "" }.
to_i(2).
tap{ |x| puts "to_i(2)"; puts x; puts "" }.
to_s(36).
tap{ |x| puts "to_s(36)"; puts x; puts "" }.
gsub(/([0-9]{3})/,'\\\\\1').
tap{ |x| puts "gsub'd"; puts x; puts "" } +'"').
tap{ |x| puts "eval'd 1"; puts x; puts "" })
end
td(12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment