Skip to content

Instantly share code, notes, and snippets.

@brushbox
Last active August 5, 2017 06:06
Show Gist options
  • Save brushbox/739e166ab3f42b2b48a1014bfa649528 to your computer and use it in GitHub Desktop.
Save brushbox/739e166ab3f42b2b48a1014bfa649528 to your computer and use it in GitHub Desktop.
reducer pipeline snippets
user_token
|> find_user_by_token
|> fetch("/messages/unread")
|> parse_json_to_message_list
|> Enum.each(&save_message(&1))
Enum.each(
parse_json_to_message_list(
fetch(find_user_by_token(user_token), "/messages/unread")
), &save_message(&1))
points
.map { |point| flood_fill(point, continent_id) }
.compact
.reduce([], &:+)
.uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment