Skip to content

Instantly share code, notes, and snippets.

@mmozuras
Created April 28, 2013 12:30
Show Gist options
  • Save mmozuras/5476751 to your computer and use it in GitHub Desktop.
Save mmozuras/5476751 to your computer and use it in GitHub Desktop.
Filter VilniusJS attendees emails
lines = File.readlines('vilniusjs_emails')
result = []
remove = false
lines.each do |line|
if line.strip.empty?
remove = true
end
emails = line.split(',')
.map(&:strip)
if remove
result -= emails
else
result += emails
end
end
puts result.compact
.uniq
.sort
.join(', ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment