Created
September 21, 2012 05:34
-
-
Save elegantcoder/3759894 to your computer and use it in GitHub Desktop.
JS Util Functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getNumericValue = (str) -> | |
str.replace(/[^-\d\.]/g, '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
makeHash = () -> | |
Math.random().toString(16).slice(2,10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sanitizeStr2HTMLElementId = (hash) -> | |
hash.replace(/[^a-zA-Z0-9\-_:\.]/, '-') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment