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 fibonacci = function(arrLength) { | |
var offset = 1; | |
var result = [0, 1]; | |
for (var i = offset; i < arrLength + offset; i++) { | |
result.push(result[i] + result[i-1]); | |
} | |
return 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
var Automobile = function() { | |
this.automobile = true; | |
} | |
var Car = function() { | |
this.car = true; | |
} | |
var Bus = function() { |
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
// We need to write a function in JavaScript that parses all the variable parts of a | |
// url, and any url parameters, into a hash. The function should take two arguments: | |
// 1. A "url format" string, which describes the format of a url that can contain | |
// constant parts and variable parts (where "parts" of a url are separated with "/"). | |
// All variable parts begin with a colon. Here is an example "url format" string: | |
// "/v6/:collecton/:id" | |
// 2. The second argument is a particular url that is guaranteed to have the format | |
// specified by the first argument. It may also contain url parameters. For instance, | |
// given the example url format string above, the second argument might be: | |
// "/v6/photos/3?size=large&res=high |
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 testCases = new Array(); | |
testCases[0] = "751843926893625174642179583425316798176982345938754612364297851289531467517468239"; | |
testCases[1] = "751843927893625174642179583425316798176982345938754612364297851289531467517468239"; | |
testCases[2] = "571843926893625174642179583425316798176982345938754612364297851289531467517468239"; | |
testCases[3] = "851743926693825174142679583425316798976182345738954612364297851289531467517468239"; | |
testCases[4] = "223275461161885667779964198782134691447868986543883499854252274298641511551153988"; | |
testCases[5] = "398126745471293685394287156874539162173982456973681245163759248927864531498612375"; | |
var SudokuValidator = function() { |
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 ValueWatcher(value, callback, prequel) { | |
var that = this; | |
this.value = value; | |
this.onBeforeSet = prequel || function(){}; | |
this.onAfterSet = callback || function(){}; | |
this.setValue = function(newVal) { | |
that.onBeforeSet(that.value, newVal); | |
that.value = newVal; | |
that.onAfterSet(newVal); | |
} |
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 longestString(i) { | |
// i will be an array. | |
// return the longest string in the array | |
var longestIndex = -1; | |
for (var j = 0; j < i.length; j++) { | |
var curStr = i[j]; |
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 arraySum(i) { | |
// i will be an array, containing integers, strings and/or arrays like itself. | |
// Sum all the integers you find, anywhere in the nest of arrays. | |
var intTotal = 0; | |
for (var j = 0; j < i.length; j++) | |
{ | |
if (typeof(i[j]) === 'number') { |
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
/* wistiaJQuery(document).bind("wistia-popover", function(event, iframe) { | |
iframe.wistiaApi.time(30).play(); | |
iframe.wistiaApi.bind("end", function() { | |
alert("The video ended!"); | |
}); | |
}); */ | |
$(document).ready(function() { | |
$("a.fancybox").fancybox(); |
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
<?php | |
// Marketo Web Service | |
// define the API key | |
$apikey = ''; | |
$staging = 'secretkey'; | |
$production = 'secretkey'; | |
if (isset($_GET["s"])) { | |
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
<?php | |
$staging = "http://marketostaging.domain.com/index.php/leadCapture/save"; | |
$production = "http://marketoproduction.domain.com/index.php/leadCapture/save"; | |
$url = ''; | |
if (isset($_GET["s"])) { | |
$stagingFlag = $_GET["s"]; |