Working with React next at 16.0.0-rc.2 using the development/non-production path, the commonjs module 'object-assign' does not result in a usable function.
- Mac OS X 10.12.6 using node 8.4 and 8.5
$ npm install && npm run build
function show_memory(interval=1000) { | |
setTimeout(show_memory, interval).unref() | |
let out = [] | |
const mem = process.memoryUsage() | |
out.push('MEM') | |
for (const [k,v] of Object.entries(mem)) { | |
out.push(`${k}: ${(v / 1.0e6).toFixed(1)} MB`) | |
} |
#!/bin/bash | |
FAIL=0 | |
for job_pid in `jobs -p`; do | |
echo "Joining job $job_pid" | |
wait $job_pid || let "FAIL+=1" | |
done | |
if [[ "$FAIL" != "0" ]]; then | |
echo Failed join processes $FAIL | |
exit 1 | |
fi |
function promiseQueue(nextPromise=() => Promise.resolve()) { | |
let tip = null | |
return function () { | |
if (null === tip) { | |
tip = nextPromise() | |
tip.then(clear_tip) } | |
return tip | |
} | |
function clear_tip() { tip = null } | |
} |
(function () { | |
'use strict'; | |
function createCommonjsModule(fn, module) { | |
return module = { exports: {} }, fn(module, module.exports), module.exports; | |
} | |
/* | |
object-assign | |
(c) Sindre Sorhus |
node_modules/ | |
*/node_modules/ | |
*/build | |
*/dist | |
./yarn.lock | |
./package-lock.json |
function promiseSome(promises) :: | |
// a cross between Promise.all and Promise.race | |
promises = Array.from(promises).filter(e => e) | |
return new Promise @ resolve => :: | |
const result = [] | |
result.done = new Promise @ done => :: | |
let count = promises.length | |
if 0 === count :: | |
resolve(result) | |
done(result) |
#!/bin/bash | |
node -e 'require("http").createServer((req,res) => {res.end([[req.method, req.httpVersion, req.url], ["On host:", require("os").hostname()], []].map(l=>l.join(" ")).join("\n"))}).listen(3001, "0.0.0.0", ()=> {})' |
## docker stack deploy -c docker-stackfile.yml gist_demo | |
version: "3.8" | |
services: | |
playground: | |
image: node:alpine | |
hostname: '{{.Task.Name}}' | |
environment: | |
SWARM_TASK: '{{.Task.Name}}' | |
SWARM_PEERS: "tasks.{{.Service.Name}}" |
class Rectangle :: | |
constructor(height, width) :: | |
this.height = height; | |
this.width = width; | |
toString() :: | |
return `(${this.height} ${this.width})`; |