This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest' | |
# = simple_google_analytics.rb | |
# | |
# Chris Le <chris at iamchrisle dot com> | |
# | |
# This module is an wrapper to export data from Google Analytics as a flattened | |
# hash suitable for database storage. It does not require any other gems other | |
# than 'oauth'. I used this simply to get metrics and directly store them in | |
# a database. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby opposite of array intersection... or maybe the method is missing from my brain bc not enough coffee | |
# http://twitter.com/soawesomeman/status/8035087261 | |
def awesome(ar_1, ar_2) | |
(ar_1 + ar_2) - (ar_1 & ar_2) | |
end | |
awesome([1,2,3,4], [3,4,5,6]) # => [1, 2, 5, 6] | |