Last active
December 31, 2015 08:29
-
-
Save boxofrad/7960840 to your computer and use it in GitHub Desktop.
This file contains 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
require 'io/console' | |
Signal.trap(:SIGINT) { exit } | |
puts "CTRL-C to quit...\n" | |
print 'Password: ' | |
password = STDIN.noecho(&:gets) | |
puts | |
loop do | |
print "Number: " | |
index = gets.strip.to_i - 1 | |
if (char = password[index]) | |
IO.popen('pbcopy', 'w') { |f| f << char } | |
puts "Copied to your clipboard!" | |
else | |
puts "Your password aint that long" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I always get this wrong and end up locking myself out of online banking!