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
20 points above the monkey | |
A Dearth of Crosswalks (via ahuster) | |
Angry Brain Explosion (via fudco) | |
Anonymous | |
Apparently Music? (via ahuster) | |
Awsomosis | |
Bad Math | |
Banned Name (via ahuster) | |
Bdemonic Devices | |
Betrayed by the Bagel (via ahuster) |
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 *count(n) { | |
for (let i = 0; i < n; i++) { | |
yield i; | |
} | |
} | |
const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
const asyncForEach = async (values, callback) => { |
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 function avery() { | |
await null; | |
for (let i = 0; i < 10; i += 1) { | |
console.log('await'); | |
await null; | |
} | |
} | |
function blake() { |
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
// @ts-check | |
/** | |
* @template T | |
* @typedef {{ | |
* promise: Promise<T>, | |
* resolve: (value:T) => void, | |
* reject: (reason:Error) => void | |
* }} Deferred | |
*/ |
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
00000000: 504b 0304 0a00 0000 0000 3514 5151 849e PK........5.QQ.. | |
^^^^ ^^^^ LOCAL_FILE_HEADER | |
^^^^ version 10 | |
^^^^ bitFlag | |
^^^^ compression method | |
^^^^ ^^^^ date | |
00000010: e8b4 0e00 0000 0e00 0000 0900 0000 6865 ..............he | |
^^^^ crc32 | |
^^^^ ^^^^ compressed size (14) | |
^^^^ ^^^^ uncompressed size (14) |
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 dependency = new Compartment({}, {}, { | |
resolveHook: (moduleSpecifier, moduleReferrer) => | |
resolve(moduleSpecifier, moduleReferrer), | |
importHook: async moduleSpecifier => { | |
const moduleLocation = locate(moduleSpecifier); | |
const moduleText = await retrieve(moduleLocation); | |
return new ModuleStaticRecord(moduleText, moduleLocation); | |
}, | |
}); | |
const application = new Compartment({}, { |
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
compartment | |
.import('./main.js') | |
.then(({ namespace: main }) => { | |
// … | |
}); |
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 'ses'; | |
lockdown(); | |
let compartment = new Compartment(); | |
compartment.evaluate(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
var Q = require("q"); | |
var HTTP = require("q-http"); | |
function httpReadRetry(url, timeout, times) { | |
return HTTP.read(url) | |
.then(function (content) { | |
return content; | |
}, function (error) { | |
if (times == 0) | |
throw new Error("Can't read " + JSON.stringify(url)); |
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 'ses'; | |
import { resolveNode, makeNodeImporter } from './node.js'; | |
const { values, entries } = Object; | |
// gathers all the packages in a lockfile into a flat representation keyed by | |
// name and version. | |
const gather = (pkg, map, location) => { | |
const key = `${pkg.name}/${pkg.version}`; | |
if (pkg.dependencies != null) { |