Created
August 21, 2011 20:56
-
-
Save typeoneerror/1161152 to your computer and use it in GitHub Desktop.
TextMate command for generating URL slug from selected text fragment
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
#!/usr/bin/env ruby | |
s = STDIN.read | |
s.downcase! | |
s.gsub!(/[^A-Za-z0-9_\- ]/, '') | |
s.gsub!(/ /, '-') | |
print s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment