npm i
deno run --unstable --compat --allow-all index.j
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
( async() => { | |
const items = 'abcdefghijklmnopqrstuvwxyz'.split(''); | |
const concurrency = 10; | |
async function process() { | |
return new Promise( r => setTimeout( r, Math.random() * 1000 ) ); | |
} | |
async function report({ item, processed, total, done }){ | |
if ( done ) { |
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
#!/bin/bash | |
# Install a custom ElasticSearch version - https://www.elastic.co/products/elasticsearch | |
# | |
# To run this script in Codeship, add the following | |
# command to your project's test setup command: | |
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/elasticsearch.sh | bash -s | |
# | |
# Add at least the following environment variables to your project configuration | |
# (otherwise the defaults below will be used). | |
# * ELASTICSEARCH_VERSION |
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
const nextTick = () => Promise.resolve(); | |
class DataLoader { | |
constructor( batch ) { | |
this.batch = batch; | |
this.queue = []; | |
this.cache = new Map(); | |
} | |
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
10.6.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
Show hidden characters
{ | |
"plugins": [ | |
"transform-flow-strip-types" | |
] | |
} |
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
function CF() {} | |
CF.P1 = 'somevalue'; | |
CF.P2 = 'somevalue'; | |
var CFp = { | |
CFP1: 'somevalue' | |
}; | |
CF.prototype = CFp; |
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
// convert an unsigned int to hex string | |
const toHex = b => ( '00' + b.toString( 16 ) ).slice( -2 ); | |
// return the SHA-1 hash of a given string | |
// note: crypto.subtle is unavailable on non-HTTPS pages | |
const sha1 = async str => { | |
const msg = new TextEncoder('utf-8').encode( str ); | |
const buf = await crypto.subtle.digest( 'SHA-1', msg ); | |
return [ ...new Uint8Array( buf ) ].map( toHex ).join(''); |
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
( () => { | |
const expect = [ 38, 38, 40, 40, 37, 39, 37, 39, 66, 65 ]; | |
const pressed = []; | |
document.addEventListener( 'keyup', e => { | |
pressed.push( e.keyCode ); | |
for ( let i = 0; i < pressed.length; ++i ) { | |
if ( pressed[ i ] !== expect[ i ] ) { | |
pressed.length = 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
'#ddd'.darker // '#a0a0a0' | |
'#ddd'.lighter // '#f0f0f0' | |
'#ddd'.darker.darker // '#808080' |
NewerOlder