Skip to content

Instantly share code, notes, and snippets.

@pry0cc
Created March 17, 2020 14:11
Show Gist options
  • Save pry0cc/84f37d7a4d0d766b3f0bb9c7bf52fd55 to your computer and use it in GitHub Desktop.
Save pry0cc/84f37d7a4d0d766b3f0bb9c7bf52fd55 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
names = File.open("names.txt").read.split("\n")
emails_who_fell = []
names[1..-1].each do |firstlast|
first = firstlast.split(" ")[0]
last = firstlast.split(" ")[1]
email = "#{first.downcase}.#{last.downcase}@gmail.com"
emails_who_fell.push(email)
end
us_emails = File.read("emails.txt")
emails_who_fell_in_usa = []
emails_who_fell.each do |email|
if us_emails.include?(email)
emails_who_fell_in_usa.push(email)
end
end
puts("the people who in the US office, who also fell for it")
puts(emails_who_fell_in_usa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment