Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
letters generator for email.js.slim
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
You can’t perform that action at this time.