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
function retry(isDone, next) { | |
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; | |
var id = window.setInterval( | |
function() { | |
if (isDone()) { | |
window.clearInterval(id); | |
next(is_timeout); | |
} | |
if (current_trial++ > max_retry) { | |
window.clearInterval(id); |
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
siteCat.authorizeHeader = function(){ | |
var nonce = guid.v1(); | |
var time = moment.utc().format().replace('+00:00', 'Z'); | |
var pass = this.generatePass(nonce, time, this.secret); | |
var token = { | |
"Username" : this.user, | |
"PasswordDigest": pass, | |
"Nonce": new Buffer(nonce).toString('base64'), | |
"Created": time, | |
} |
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:(function(){if(window.__satellite_tool_loading){return;}window.__satellite_tool_loading=true;var head=document.getElementsByTagName('head')[0],path='https://dtm.adobe.com/assets/';window.__sdsat_path='https://dtm.adobe.com/';window.__sdsat_api_token='YourAPIToken';window.__sdsat_username='yourUserName';var widget={required_assets:[path+'satellite_html.js',path+'satelliteUtils.js'],assets_loaded:0,loadScript:function(src,cb){var script=document.createElement('script');script.type='text/javascript';script.src=src;script.onreadystatechange=function(){if(this.readyState==="loaded" || this.readyState==="complete"){cb();}};script.onload=cb;head.appendChild(script);},loadjQuery:function(){if('$' in window){window.temp$=window.$;}if('jQuery' in window && window.jQuery!==undefined){window.$jQuery=jQuery.noConflict(true);window.$=window.temp$;}widget.loadScript('https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',function(){var jq=jQuery.noConflict(true);window.j$=jq;window.jQuery=window.$jQuer |
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
//made with help from https://developer.mozilla.org/en-US/docs/DOM/window.navigator.geolocation.getCurrentPosition | |
function setPositionFromCurrent(){ | |
//this requires HTML5 | |
if (!!navigator.geolocation){ | |
navigator.geolocation.getCurrentPosition(function (position){ | |
var coords = position.coords; | |
console.log('Latitude : ' + coords.latitude); | |
console.log('Longitude: ' + coords.longitude); | |
window.lat = coords.latitude; |
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
<script type="text/javascript"> | |
var _snaq = _snaq || []; | |
_snaq.push(['setCollectorCf', 'CLOUDFRONT SUBDOMAIN}}']); | |
_snaq.push(['trackPageView']); | |
_snaq.push(['enableLinkTracking']); | |
(function() | |
var sp = document.createElement('script'); sp.type = 'text/javascript'; sp.async = true; sp.defer = true; | |
sp.src = ('https:' == document.location.protocol ? 'https' : 'http') + '://d1fc8wv8zag5ca.cloudfront.net/0.11.1/sp.js'; |
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
function mergeProperties(inputArray, placeHolderValue){ | |
//expects an array of objects | |
//each object has properties | |
//need to convert properties to arrays | |
//e.g. [{a:2, b:3, c:7}, {a:4, b:5}] -> [["a", "b", "c"], [2, 3, 7], [4, 5, 0]] | |
//any empty values should get set to "" | |
var allProperties = {}; | |