-
-
Save nullcookies/47bd36b8b7c4b9b24f8c64c0b3529eb9 to your computer and use it in GitHub Desktop.
letters generator for email.js.slim
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
str = '<a href="mailto:#{ARGV[0]}">#{ARGV[0]}</a>' | |
# ARGV[0] = 'user@example.com' | |
# str = '<a href="mailto:user@example">user@example</a>' | |
original = str.split("") | |
new_arr = [] | |
original.each_index {|i| new_mas << { i => original[i] } } | |
new_arr.shuffle! | |
letters = [] | |
positions = [] | |
new_arr.each { |i| letters << i.values[0]; positions << i.keys[0] } | |
print "var aixccwp = #{letters};" | |
puts "" | |
print "var fsklvjp = #{positions};" | |
puts "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment