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
/// base functions | |
const files = { | |
file1: "first text", | |
file2: "middle text", | |
file3: "last text" | |
}; | |
function readFile(file, success) { | |
const delay = parseInt(Math.random() * 2000 + 500, 10); |
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
/** | |
* Fit a given index into a given array | |
* length, while properly handling overflow | |
* | |
* so for eg: | |
* - given length=10 & index=3 -> return 3 | |
* - given length=10 & index=14 -> return 4 (overflow) | |
* - given length=10 & index=-2 -> return 8 (overflow) | |
* | |
* @param index |
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
import deepEqual from 'deep-equal'; | |
/** | |
* A basic Map implementation whose keys hold a deep equality | |
* relationship but not a referential equality relationship | |
* | |
*/ | |
export default class LooseMap { | |
constructor() { | |
this.__entries__ = []; |
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
/** | |
* Curry the given function | |
* | |
* @param func {Function} the function to curry | |
* @param context {Object} (optional) the execution context to | |
* apply/bind to the returned curried | |
* function | |
* @returns {Function} | |
*/ | |
function curry(func, context = null) { |
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 | |
/** | |
* | |
*/ | |
/** | |
* Class MCF_Templater | |
* | |
* Based on work by Harri Bell-Thomas <https://github.com/HarriBellThomas> |
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
/* eslint-disable */ | |
/** | |
* Approximately list packages that are | |
* registered in your package json but | |
* not used in your code | |
* | |
*/ | |
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
/** | |
* Kilometers per hour to | |
* Beaufort scale | |
* | |
* @param kmh | |
* @returns {number} | |
*/ | |
function kmh2bf(kmh) { | |
var bf = 0; | |
var i = 0; |
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
/** | |
* Error handling helper with builtin debugMode | |
* toggle | |
* | |
* @author: Max GJ Panas <http://maxpanas.com> | |
* @license: MIT | |
* | |
* Based on ideas from Nicholas Zakas expressed in his article: | |
* http://www.nczonline.net/blog/2009/04/28/javascript-error-handling-anti-pattern/ | |
*/ |
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
<figure class="wrap"> | |
<div class="clock-wrap"> | |
<div class="clock"> | |
<div id="clock_hours"></div> | |
</div> | |
<div class="ticker" id="ticker_hours"></div> | |
</div> | |
<div class="clock-wrap"> | |
<div class="clock"> | |
<div id="clock_minutes"></div> |