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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<input type="file" id="files" name="files[]" multiple /> | |
<output id="list"></output> | |
<script> |
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
(function() { | |
var emojis = ["😀","😁","😂","😃","😄","😅","😆","😉","😊","😋","😎","😍","😘","😗","😙","😚","☺️","🙂","🤗","😇","🤓","🤔","😐","😑","😶","🙄","😏","😣","😥","😮","🤐","😯","😪","😫","😴","😌","😛","😜","😝","😒","😓","😔","😕","🙃","🤑","😲","😷","🤒","🤕","☹️","🙁","😖","😞","😟","😤","😢","😭","😦","😧","😨","😩","😬","😰","😱","😳","😵","😡","😠","😈","👿","👹","👺","💀","☠️","👻","👽","👾","🤖","💩","😺","😸","😹","😻","😼","😽","🙀","😿","😾","🙈","🙉","🙊","👦","👦🏻","👦🏼","👦🏽","👦🏾","👦🏿","👧","👧🏻","👧🏼","👧🏽","👧🏾","👧🏿","👨","👨🏻","👨🏼","👨🏽","👨🏾","👨🏿","👩","👩🏻","👩🏼","👩🏽","👩🏾","👩🏿","👴","👴🏻","👴🏼","👴🏽","👴🏾","👴🏿","👵","👵🏻","👵🏼","👵🏽","👵🏾","👵🏿","👶","👶🏻","👶🏼","👶🏽","👶🏾","👶🏿","👱","👱🏻","👱🏼","👱🏽","👱🏾","👱🏿","👮","👮🏻","👮🏼","👮🏽","👮🏾","👮🏿","👲","👲🏻","👲🏼","👲🏽","👲🏾","👲🏿","👳","👳🏻","👳🏼","👳🏽","👳🏾","👳🏿","👷","👷🏻","👷🏼","👷🏽","👷🏾","👷🏿","⛑️","👸","👸🏻","👸🏼","👸🏽","👸🏾","👸🏿","💂","💂🏻","💂🏼","💂🏽","💂🏾","💂🏿","🕵️","🕵️🏻","🕵️🏼","🕵️🏽","🕵️🏾","🕵️🏿","🎅","🎅🏻","🎅🏼","🎅🏽","🎅🏾","🎅🏿","👰","👰🏻","👰🏼","👰🏽","👰🏾","👰🏿","👼","👼🏻","👼🏼","👼🏽","👼🏾","👼🏿","💆","💆🏻","💆🏼","💆🏽","💆🏾","💆🏿","💇","💇🏻","💇🏼","💇🏽","💇🏾","💇🏿","🙍","🙍🏻","🙍🏼","🙍🏽","🙍🏾","🙍🏿","🙎","🙎 |
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
[{ | |
"emoji": "😀", | |
"name": "GRINNING FACE", | |
"code": "U+1F600" | |
}, { | |
"emoji": "😁", | |
"name": "GRINNING FACE WITH SMILING EYES", | |
"code": "U+1F601" | |
}, { | |
"emoji": "😂", |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="style.css"> | |
<style> | |
textarea { | |
width: calc(100% - .5em); | |
height: 50vh; | |
} |
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
'use strict'; | |
module.exports = function nodePromise(fn) { | |
return new Promise((resolve, reject) => { | |
fn((err, res) => err ? reject(err) : resolve(res)); | |
}); | |
}; |
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
function MovingAverage(size) { | |
this.buckets = []; | |
while (1 + size--) { | |
this.buckets.push(0); | |
} | |
this.i = 0; | |
this.average = 0; | |
} | |
MovingAverage.prototype.add = function add(n) { |
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
'use strict'; | |
const coins = [100,25,10,5,1]; | |
const optimal = coinCount(48); | |
console.log(coinCount(25, without(coins, 25))); | |
console.log( | |
optimal.map(n => coinCount(n)).join('\n') | |
); |
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 lookups = { | |
1: [''], | |
2: ['a', 'b', 'c'], | |
3: ['d', 'e', 'f'], | |
4: ['g', 'h', 'i'], | |
5: ['j', 'k', 'l'], | |
6: ['m', 'n', 'o'], | |
7: ['p', 'q', 'r', 's'], | |
8: ['t', 'u', 'v'], | |
9: ['w', 'x', 'y', 'z'], |
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
// travel tickets | |
// Output order of travels, from start to end | |
var cities = 'Seattle, San Francisco, Austin, New York, Los Angeles, Portland, Chicago, Shanghai'.split(', '); | |
var count = 150; | |
var trip = []; | |
for (var i = 0; i < count; i++) { | |
var start = pickRand(cities); | |
var end = pickRand(cities); | |
while (end === start) { |
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 removeDiacritics = (function() { | |
const map = { | |
A: '\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F', | |
AA: '\uA732', | |
AE: '\u00C6\u01FC\u01E2', | |
AO: '\uA734', | |
AU: '\uA736', | |
AV: '\uA738\uA73A', | |
AY: '\uA73C', |