r/coffeescript • u/Arkolix • May 28 '12
Suggesting URL aliases with CoffeeScript
http://andrewberls.com/blog/post/suggesting-url-aliases-with-coffeescript
1
Upvotes
r/coffeescript • u/Arkolix • May 28 '12
2
u/name_was_taken May 29 '12
Instead of blacklisting bad characters, I'd probably have chosen to whitelist good ones. Keep all the letters and numbers.
Run a regex match against the string and then join all the matches with a -.