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
String.prototype.map = function(predicate) { | |
const arr = [] | |
for (var i = 0; i < this.length; i++) { | |
arr.push(predicate(this.charAt(i), i)) | |
} | |
return arr.join('') | |
} | |
// ᕕ( ᐛ )ᕗ |
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
location.search.slice(1).split('&').map(pair => pair.split('=')).reduce((params, curr) => { params[curr[0]] = curr[1]; return params }, {}) |
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
var test = new Promise((resolve, reject) => { | |
var longReject; | |
var LONG = new Promise((resolve, reject) => { | |
longReject = reject; | |
setTimeout(() => resolve(), 5000) | |
}) | |
.then(() => console.log('LONG: resolved after 5 seconds')) | |
.catch(() => console.warn('LONG: rejected!')) | |
setTimeout(() => { |
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 MODULE_NAME = 'ModuleX' | |
const log = (...args) => console.log.apply(console, [`[${MODULE_NAME}] > `, ...args]) | |
const info = (...args) => console.info.apply(console, [`[${MODULE_NAME}] > `, ...args]) | |
const warn = (...args) => console.warn.apply(console, [`[${MODULE_NAME}] > `, ...args]) | |
const error = (...args) => console.error.apply(console, [`[${MODULE_NAME}] > `, ...args]) | |
log('testing', ['apple', 'orange', 'car'], 1337) |
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
var os = require('os'); | |
var fs = require('fs'); | |
// Change the project name to match yours | |
// Find it in your flow file | |
// project.app.name = ? | |
var projectName = 'grayscale'; | |
exports.hook = function(flow, done) { |