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
def load_mixpanel | |
@mixpanel ||= Mixpanel::Tracker.new "#{mixpanel_key}", { :env => request.env } | |
if current_user | |
@mixpanel.append_people_identify mixpanel_distinct_id | |
mixpanel_set(mixpanel_distinct_id, current_user.mixpanel_properties) | |
@mixpanel.append("name_tag", current_user.email) | |
end | |
end |
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
module MixpanelHelper | |
def mixpanel_track_with_super_properties(event_name, properties = {}) | |
properties = properties.merge(get_super_properties) unless get_super_properties.nil? | |
properties = properties.merge(:distinct_id => mixpanel_distinct_id) | |
@mixpanel.track(event_name, properties) | |
end | |
def mixpanel_set(distinct_id, properties = {}) | |
@mixpanel.set(distinct_id, properties) |
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
module MixpanelHelper | |
def mixpanel_track_with_super_properties(event_name, properties = {}) | |
properties = properties.merge(get_super_properties) unless get_super_properties.nil? | |
properties = properties.merge(:distinct_id => mixpanel_distinct_id) | |
@mixpanel.track(event_name, properties) | |
end | |
def mixpanel_set(distinct_id, properties = {}) |
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
:javascript | |
var readyFunc = function() { | |
if(typeof(pubnub) == "undefined"){ | |
var pubnub = PUBNUB.init({ | |
subscribe_key : "#{CONFIG['pubnub_subscribe_key']}" | |
}) | |
} |
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
:javascript | |
var readyFunc; | |
readyFunc = function() { | |
if(typeof(pubnub) == "undefined"){ | |
var pubnub = PUBNUB.init({ | |
subscribe_key : "#{CONFIG['pubnub_subscribe_key']}" | |
}) | |
} |
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
module MixpanelHelper | |
def mixpanel_track_with_super_properties(event_name, properties = {}) | |
properties = properties.merge(get_super_properties) unless get_super_properties.nil? | |
properties = properties.merge(:distinct_id => mixpanel_distinct_id) | |
@mixpanel.track(event_name, properties) | |
end | |
def mixpanel_set(distinct_id, properties = {}) | |
@mixpanel.set(distinct_id, properties) |
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
#customer-info{'data-message-channel' => "#{current_user.company.channel if user_signed_in?}", 'data-customer-id' => "#{@customer.id if @customer}", 'data-customer-first-name' => "#{@customer.first_name if @customer}"} | |
#key-info{'data-subscribe-key' => "#{ENV['PUBNUB_SUBSCRIBE_KEY'] || CONFIG['pubnub_subscribe_key']}"} | |
:javascript | |
if(pubnub == undefined){ | |
var pubnub = PUBNUB.init({ | |
subscribe_key : $('#key-info').data('subscribe-key') | |
}) | |
} |
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
module MixpanelHelper | |
def mixpanel_key | |
Rails.env.production? ? 'xxx' : 'yyy' | |
end | |
def mixpanel_track_with_super_properties(event_name, properties = {}) | |
properties = properties.merge(get_super_properties) unless get_super_properties.nil? | |
properties = properties.merge(:distinct_id => mixpanel_distinct_id) | |
@mixpanel.track(event_name, properties) |
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
Sep 01 17:18:01 texthub app/web.1: Parameters: {"text"=>"Hey Joshua, welcome to StudySoup! Upload a note sample to StudySoup.com for verification and I’ll get back to you in a few days! - Sieva", "to"=>"(805)794-3264", "token"=>"6csuucmW1-iF8CJpPne1iQbexZaJjfoo"} | |
Sep 01 17:18:01 texthub app/web.1: Parameters: {"text"=>"Hey Joshua, welcome to StudySoup! Upload a note sample to StudySoup.com for verification and I’ll get back to you in a few days! - Sieva", "to"=>"(805)794-3264", "token"=>"6csuucmW1-iF8CJpPne1iQbexZaJjfoo"} | |
Sep 01 17:18:01 texthub app/web.1: Parameters: {"text"=>"Joshua, don’t forget to tell your classmates that your notes are posted for sale on StudySoup.com. Share your link = $$$!", "to"=>"(805)794-3264", "token"=>"6csuucmW1-iF8CJpPne1iQbexZaJjfoo"} | |
Sep 01 17:18:01 texthub app/web.1: Parameters: {"text"=>"Joshua, don’t forget to tell your classmates that your notes are posted for sale on StudySoup.com. Share your link = $$$!", "to"=>"(805)794-3264", "token"=>"6csuucmW1-iF8CJpPn |
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
# PostgreSQL. Versions 8.2 and up are supported. | |
# | |
# Install the pg driver: | |
# gem install pg | |
# On OS X with Homebrew: | |
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config | |
# On OS X with MacPorts: | |
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config | |
# On Windows: | |
# gem install pg |
OlderNewer