Last active
January 10, 2020 08:56
-
-
Save sshkarupa/96eca48b3bd34f024b69 to your computer and use it in GitHub Desktop.
letters generator for email.js.slim
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
str = '<a href="mailto:#{ARGV[0]}">#{ARGV[0]}</a>' | |
# ARGV[0] = '[email protected]' | |
# 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