Created
March 2, 2016 19:11
-
-
Save zachjamesgreen/e7119d273401583a5fa2 to your computer and use it in GitHub Desktop.
Revisions
-
zachjamesgreen created this gist
Mar 2, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #!/usr/bin/env ruby require "awesome_print" if ARGV.empty? || ARGV[0] == '' || ARGV[0].empty? length = 10 else length = ARGV[0].to_i end ap "Generating random string of length #{length}" r = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a + %w(! @ # { $ % ^ & * ? < > }) ap (0...length).map { r[rand(75)] }.join