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
#!/usr/bin/env node | |
// Generate a graphviz (graphviz.org) .dot file for the package relationships | |
// of the currently running N|Solid instances, using the N|Solid 1.3 | |
// package_info command. | |
'use strict' | |
var fs = require('fs') | |
var path = require('path') |
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
'use strict' | |
const http = require('http') | |
const server = http.createServer( (req, res) => { | |
res.writeHead(500, {'Content-Type': 'text/plain'}) | |
res.end('500') | |
}) | |
const PORT = process.env.PORT || "3000" |
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
'use strict' | |
const max = Number.MAX_SAFE_INTEGER // 9007199254740991 | |
console.log('Number.MAX_SAFE_INTEGER: ', nice(max)) | |
console.log('') | |
// Number.MAX_SAFE_INTEGER: 9,007,199,254,740,991 | |
console.log('how many time units fit in', nice(max), 'microseconds') |
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
'use strict' | |
// see: https://github.com/nodejs/node/pull/6157 | |
var startTime = process.hrtime() | |
var startUsage = process.cpuUsage() | |
// spin the CPU for 500 milliseconds | |
var now = Date.now() | |
while (Date.now() - now < 500) |
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
{ | |
"method": "$context.httpMethod", | |
"resourcePath": "$context.resourcePath", | |
"querystring": { | |
#foreach($key in $input.params().querystring.keySet()) | |
"$key": "$input.params().querystring.get($key)"#if($foreach.hasNext),#end | |
#end | |
}, | |
"path": { | |
#foreach($key in $input.params().path.keySet()) |
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
'use strict' | |
module.exports = yieldCallback | |
// Call functions that use async callbacks, in an "synchronous" type style from | |
// within a generator. | |
if (require.main === module) test() | |
// example invoking a yielding callback generator |
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
#!/usr/bin/env node | |
'use strict' | |
const fs = require('fs') | |
const path = require('path') | |
const LaunchFile = '.vscode/launch.json' | |
const LaunchDir = path.dirname(LaunchFile) |
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
'use strict' | |
const fs = require('fs') | |
// promise-style fs subset (at bottom of this file) | |
const fsp = requirePromised_fs() | |
// read 12 bytes of this file, print them, or print error if that happens | |
readFile(__filename, 12) | |
.then(s => console.log('read:', s.toString())) |
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 | |
#------------------------------------------------------------------------------- | |
# download/unpack componentry for N|Solid into ~/nsolid | |
#------------------------------------------------------------------------------- | |
# directories | |
DIR_DOWN=~/Downloads | |
DIR_INST=~/nsolid |
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
'use strict' | |
const fs = require('fs') | |
class Steps { | |
constructor (tx) { | |
this.tx = tx | |
this.steps = [] | |
this.runningSeries = false | |
this.runningParallel = false |