Skip to content

Instantly share code, notes, and snippets.

@stephantabor
stephantabor / bb.js
Last active January 6, 2024 04:18
Bluebird .each vs .mapSeries vs .map
var Promise = require('bluebird');
var funcs = Promise.resolve([500, 100, 400, 200].map((n) => makeWait(n)));
funcs
.each(iterator) // logs: 500, 100, 400, 200
.then(console.log) // logs: [ [Function], [Function], [Function], [Function] ]
funcs
.mapSeries(iterator) // logs: 500, 100, 400, 200
@mitchwongho
mitchwongho / Docker
Last active November 29, 2023 06:36
Docker 'run' command to start an interactive BaSH session
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash