Created
September 8, 2010 21:40
-
-
Save robballou/570888 to your computer and use it in GitHub Desktop.
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 | |
# | |
# Textmate command for inserting a random string | |
# | |
# Input: none | |
# Output: Insert as text | |
# based on: http://stackoverflow.com/questions/88311/how-best-to-generate-a-random-string-in-ruby | |
o = [('a'..'z'),('A'..'Z')].map{|i| i.to_a}.flatten; | |
string = (0..50).map{ o[rand(o.length)] }.join; | |
print string.strip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment