Skip to content

Instantly share code, notes, and snippets.

@jonneale
Last active December 24, 2015 00:49
Show Gist options
  • Save jonneale/6719280 to your computer and use it in GitHub Desktop.
Save jonneale/6719280 to your computer and use it in GitHub Desktop.
ruby hello world
%q{10 10 1000111 00 11 1010010 11 101 10 0010101 0000111 11 01000 01110
11 00 11 00 10 10 01 01 001 11 00 01 11 11 10 01 11 10011
01 00 01 10 00 01 01 11 010 01 11 01 11 11 00 11 11 11010
0010100 110101 00 00 10 01 11 011 01 10 01 11110 01 00 10 00101
11 00 10 10 00 01 01 00 010 11 10 01 11 10 10 11 01
11 00 01 10 11 01 00 0 0 1 00 00 10 00 10 10 00 11011
11 10 001001 101111 11101 0110111 01 01 1110010 01 10 010010 10101 00001}.
gsub(/\D/, "").
to_i(2).
to_s.
to_i(2).
to_s(2).
insert(0,"0").
scan(/.{8}/).
map{|c| c.to_i(2).
to_s(16).
hex.
chr}.
join
#=> hello world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment