Skip to content

Instantly share code, notes, and snippets.

View sorahn's full-sized avatar
🎩

Daryl Roberts sorahn

🎩
  • Tovia, LLC
  • Atlanta
View GitHub Profile
@sorahn
sorahn / gist:9442634
Created March 9, 2014 03:46
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 +@