Skip to content

Instantly share code, notes, and snippets.

@sorahn sorahn/gist:9442634
Created Mar 9, 2014

Embed
What would you like to do?
Simple hex helpers.
# Parse ini style numbers in strings.
# hex = '$123ABC'
# dec = '123456'
String::getHex = -> parseInt @, 16
String::iniHex = -> if "#{@.charAt 0}" is '$' then do "#{@.slice 1}".getHex else +@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.