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
let pad = val => String(val).padStart(2, '0'); | |
let getTimestamp = () => { | |
let opts = ['day', 'month', 'year', 'hour', 'minute', 'second'] | |
.reduce((res, key) => (res[key] = '2-digit') && res, { hour12: false }); | |
return new Date().toLocaleString(undefined, opts); | |
}; | |
let prependTimestamp = (fn) => ({ | |
apply(target, arg, args) { |
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
/** | |
* Demonstration of how to RELEASE ZALGO | |
* @author Bastian Masanek (2017) | |
*/ | |
let cache; | |
function releaseZalgo(cb) { | |
if (cache) { | |
// This is synchronous and execucted immediately. |