Created
April 29, 2013 11:12
-
-
Save zamith/5480996 to your computer and use it in GitHub Desktop.
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 track_event_on_mixpanel | |
Resque.enqueue MixpanelTrackEventJob, "Event", properties, env | |
end |
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
class MixpanelTrackEventJob | |
@queue = :slow | |
def self.mixpanel env | |
Mixpanel::Tracker.new MIXPANEL_TOKEN, { :env => env } | |
end | |
def self.perform name, properties, env | |
mixpanel(env).track name, properties | |
end | |
end |
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
rails_root = Rails.root | |
rails_env = Rails.env | |
resque_config = YAML.load_file(rails_root.to_s + '/config/resque.yml') | |
Resque.redis = resque_config[rails_env] |
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
development: localhost:6379 | |
production: localhost:6379 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment