Once the Segment library is integrated with your site, toggle SimpleReach on in your Segment integrations, and add your PID that was given to you by the SimpleReach client services team.
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
let tests = [ | |
[Math.max(1, 3), 3, 'can pass'], | |
[Math.max(1, 4), 3, 'can fail'], | |
]; | |
tests.forEach((test) => | |
console.log( | |
test[0].toString() === test[1].toString() ? 'pass!' : 'fail!', | |
'expected:', | |
test[1], | |
'result:', |
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
{ | |
report_items: [ | |
{ | |
mobile_search_referrals: 10, | |
tablet_search_referrals: 11, | |
desktop_search_referrals: 1678, | |
search_referrals: 1699, | |
mobile_internal_referrals: 2, | |
tablet_internal_referrals: 1, |
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
curl 'http://webapi.simplereach.com/data/exports' -H 'Origin: http://www.simplereach.com' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.8,ga;q=0.6' -H 'SREMAIL: amalan@simplereach.com' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36' -H 'Content-Type: application/json; charset=UTF-8' -H 'SRTOKEN: TkMizDsxifJ7SKDAyGFb' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'Referer: http://www.simplereach.com/app/site/5437e8b7d70ba0f2a7000073/intel/reports?timeFrame=Jul%2016%2C%202015' -H 'Connection: keep-alive' -H 'X-FirePHP-Version: 0.0.6' --data-binary '{"export":{"status":null,"created_at":null,"filename":null,"url":null,"board_name":null,"board_id":"5437e8b7d70ba0f2a7000073","name":"IBM-export-brian","url_hash":null,"field":"articles","options":{"sort":"referrals","sort_dir":"desc","sort_network":"all","page":1,"per_page":30},"filters":{"time_frame":"Jul 16, 2015","published_at":"All |
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
var server = sinon.fakeServer.create(); | |
server.autoRespond = true; | |
server.autoRespondAfter = 100; | |
server.xhr.useFilters = true; | |
server.xhr.addFilter(function(method, url) { | |
//whenever the this returns true the request will not faked | |
var fake = true; | |
server.responses.forEach(function(response){ | |
if(response.url === url){ |
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
Redbot.PostsNewFileRoute = Redbot.BaseQuickPostRoute.extend | |
events: | |
save: -> | |
post = @get("currentModel") | |
controller = @controllerFor('posts.newFile') | |
attachment = controller.get('attachment') | |
Ember.run.next @, -> | |
post.set('attachmentId', attachment.get('id')) | |
post.one 'didCreate', => | |
Ember.run.next @, -> |
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
//serializer | |
class PostSerializer < ActiveModel::Serializer | |
embed :ids | |
attributes :id, :title, :body, :thumbnail, :created_at, :profile_id | |
has_many :comments | |
has_many :hashtags | |
end | |