This file contains hidden or 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 | |
for ($i=1; $i <= 100; $i++) { | |
if ((($i % 3) == 0) && (($i % 5) == 0)) { | |
echo "FizzBuzz\n"; | |
continue; | |
} | |
elseif (($i % 3) == 0) { | |
echo "Fizz\n"; | |
continue; | |
} |
This file contains hidden or 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
/** | |
* is One Point within Another | |
* @param point {Object} {latitude: Number, longitude: Number} | |
* @param interest {Object} {latitude: Number, longitude: Number} | |
* @param kms {Number} | |
* @returns {boolean} | |
*/ | |
const LocationChecker = (point, interest, kms) => { | |
let R = 6371; // Earth radius | |
let deg2rad = (n) => { return Math.tan(n * (Math.PI/180)) }; // function that converts degrees to radians |
This file contains hidden or 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
const DeepClone = (obj) => { | |
let copy; | |
// Handle the 3 simple types, and null or undefined | |
if (null === obj || "object" !== typeof obj) return obj; | |
// Handle Date | |
if (obj instanceof Date) { | |
copy = new Date(); | |
// A way to make one Date the same as another is by calling the setTime method |