Skip to content

Instantly share code, notes, and snippets.

@defHLT
Created October 20, 2013 23:42
Show Gist options
  • Save defHLT/7076717 to your computer and use it in GitHub Desktop.
Save defHLT/7076717 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
a, b, c, d = $*[0].split('.').map(&:to_i)
i = a * 256**3 + b * 256**2 + c * 256 + d
puts "dec: http://" << i.to_s
puts "hex: http://0x" << i.to_s(16)
puts "oct: http://0" << i.to_s(8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment