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
/***** Dan Wilkerson * @notdanwilkerson *****/ | |
// Simple function to return the value of the nth number of the Fibonacci sequence. | |
// Requires BigInteger by silentmatt ( http://silentmatt.com/biginteger/ ) | |
// To see a working webapplication that uses this code visit | |
// http://www.danwilkerson.com/apps/code140/fibonacci/fibonacci.html | |
function fibonachocheese(number){ | |
if (number % 1 !== 0 || number < 0 || number > 100000) { |
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 (){ | |
for(i = 1; i < 101; i++) { | |
if (i % 3 === 0 && i % 5 === 0) { | |
console.log('FizzBuzz'); | |
} else if (i % 3 === 0) { | |
console.log('Fizz'); | |
} else if (i % 5 === 0) { | |
console.log('Buzz'); | |
} else { | |
console.log(i); |
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
/** | |
* Generates a client ID in the format historically used by the Google Analytics | |
* JavaScript libraries. Note that any alphanumeric value may be used, but | |
* ideally each should be unique to a given client. | |
* | |
* More information on Client IDs: | |
* https://developers.google.com/analytics/devguides/collection/protocol/v1/email#client-id-cid | |
*/ | |
function generateGaClientId() { |
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
/** | |
* Exposes policies during testing to allow for stubbing when testing controllers. | |
* Useful when you need to bypass a policy for authorized controllers. | |
* | |
* Originally created by @joepuzzo (https://github.com/joepuzzo) | |
* Updated by @notdanwilkerson (https://github.com/notdanwilkerson) | |
* | |
* Usage (in test file): | |
* | |
* let authStub; |