Skip to content

Instantly share code, notes, and snippets.

:javascript
var readyFunc = function() {
if(typeof(pubnub) == "undefined"){
var pubnub = PUBNUB.init({
subscribe_key : "#{CONFIG['pubnub_subscribe_key']}"
})
}
:javascript
var readyFunc;
readyFunc = function() {
if(typeof(pubnub) == "undefined"){
var pubnub = PUBNUB.init({
subscribe_key : "#{CONFIG['pubnub_subscribe_key']}"
})
}
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)
#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')
})
}
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)
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
# 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
class PingWidgetsController < ApplicationController
skip_before_filter :verify_authenticity_token, only: [:cors_set_access_control_headers, :cors_preflight_check]
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def settings
headers['Access-Control-Allow-Origin'] = '*'
if params.has_key?(:uuid)
Texthub::Application.routes.draw do
mount_roboto
mount Api, at: '/api'
authenticated :user do
root to: 'home#index', as: 'authenticated_root'
end
root 'home#homepage'
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
devise_for :users, controllers: { invitations: 'users/invitations', registrations: 'registrations', sessions: 'sessions' }
# new api
class Api < Grape::API
version 'v1'
format :json
use Rack::Timeout
rescue_from Rack::Timeout::RequestTimeoutError do |e|
NewRelic::Agent.instance.error_collector.notice_error e,
uri: env["api.endpoint"].request.path,
referer: env["api.endpoint"].request.referer,