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
//This is a fix to get the user-extensions working for RC. The check is to prevent a runtime error in the IDE | |
//since the IDE does not contain command factory. | |
if(this['commandFactory']){ | |
commandFactory.registerAll(selenium); | |
} |
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
/** | |
* calculateZ() is a simplified version of a race conidtion. We have two ansync tasks | |
* that modifiy the state before each call is complete. | |
*/ | |
function calculateZ() { | |
let x = 0, y = 0, z; | |
//Async call to get the true value of y | |
setTimeout(() => y = 2, Math.random() * 1000); | |
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
/** | |
* calculateZChained() Chain the two aysnc calls together to fix the race condition. | |
*/ | |
function calculateZChained() { | |
let x = 0, y = 0, z; | |
//Async call to get the true value of y | |
setTimeout(() => { | |
y = 2; | |
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
/** | |
* calculatePromise() Use promises to get x and y values, now we can run our | |
* async tasks in parallel using Promise.all. Once we have both values | |
*/ | |
function calculatePromise() { | |
var y = new Promise((resolve, reject) => { | |
setTimeout(() => resolve(2), Math.random() * 1000); | |
}); | |
var x = new Promise((resolve, reject) => { |
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 zipCodeData = { | |
'30324': { | |
value: 10 | |
//Etc. | |
} | |
}; | |
var map = new google.maps.Map(document.getElementById('map-canvas'), {}); | |
var zipPolys = createZipPolygons(map); |
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
angular.module('valueIntelligence.test', []) | |
.config(function(VIBirstProvider) { | |
VIBirstProvider.setConfig({ | |
url: '' | |
}); | |
}); | |
angular.module('valueIntelligence.test').provider('VIBirst', function(){ | |
var saConfig = {}; | |
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
//So writing out the arrays like this works but will lead to bugs b/c since allQueries is just conversionTotalsQueries and conversionTypeQueries | |
//combined you might forget to update one array. To prevent that just concat the two. | |
var allQueries = [conversionsQueryMonth, leadsQueryMonth, actionsQueryMonth, conversionsQueryDay, leadsQueryDay, actionsQueryDay]; | |
var conversionTotalsQueries = [conversionsQueryMonth, conversionsQueryDay]; | |
var conversionTypeQueries = [actionsQueryMonth, actionsQueryDay, leadsQueryMonth, leadsQueryDay]; | |
//refactored to use less code and prevent bugs | |
var conversionTotalsQueries = [conversionsQueryMonth, conversionsQueryDay]; | |
var conversionTypeQueries = [actionsQueryMonth, actionsQueryDay, leadsQueryMonth, leadsQueryDay]; | |
var allQueries = conversionTotalsQueries.concat(conversionTypeQueries); //Returns new array so conversionTotalsQueries is not modified |
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
<!-- Start Captionable Widget Tag --> | |
<script> | |
var username = 'charliereid'; | |
var width = 300; | |
var height = 250; | |
document.write('<iframe src="http://play.captionable.com/widget/'+ encodeURI(username) +'?w='+ width +'&h='+ height +'" width="'+ width +'" height="'+ height +'" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no" allowtransparency="true"></iframe>'); | |
</script> | |
<!-- End Captionable Widget Tag --> |
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
<div style="width:300px; height:250px; text-align: center;"> | |
<a href="http://play.captionable.com/widget/charliereid/link" target="_blank" style="padding: 0;margin: 0;"> | |
<img src="http://play.captionable.com/widget/charliereid/image" alt="Can you guess the caption?" height="250" width="250"> | |
</a> | |
</div> |
OlderNewer