brew install postgres
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
ARCHFLAGS="-arch x86_64" gem install pg
initdb /usr/local/var/postgres9.3 -E utf8
pg_ctl -D /usr/local/var/postgres9.3 -l logfile start
This file contains hidden or 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
def anonymousId provider | |
case provider | |
when "Segment" | |
anonId = request.cookies["ajs_anonymous_id"].gsub("\"", "") | |
when "Mixpanel" | |
mp = request.cookies.detect{ |key| key.to_s =~ Regexp.new("mp_.+_mixpanel") }[1].split(': ') | |
anonId = mp[1].gsub(",\"$initial_referrer\"", "").gsub("\"", "") | |
when "Google" | |
anonId = request.cookies["_ga"][6..-1] | |
else |