Skip to content

Instantly share code, notes, and snippets.

@deepfryed
Created February 15, 2012 03:17
Show Gist options
  • Save deepfryed/1832891 to your computer and use it in GitHub Desktop.
Save deepfryed/1832891 to your computer and use it in GitHub Desktop.
unique { f(n) | n ϵ N }
module Enumerable
def uniq_by &block
seen = {}
reject {|value| seen.key?(block.call(value)) ? true : seen[block.call(value)] = false}
end
end
@deepfryed
Copy link
Author

well i need find a good optometrist for dan /O-O/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment