Parallelization made easy in JavaScript / Node.js
var road = new Road();
road.onClear(function (error, results) {
apis = [] | |
foreach result in results do | |
await api = async client.getApiById | |
id: result.apiId | |
if !api continue | |
await api.account = do | |
async client.getAccountById |
Built-in Atom packages (74) | |
├── archive-view@0.33.0 | |
├── atom-dark-syntax@0.19.0 | |
├── atom-dark-ui@0.32.0 | |
├── atom-light-syntax@0.20.0 | |
├── atom-light-ui@0.28.0 | |
├── autocomplete@0.28.0 | |
├── autoflow@0.17.0 | |
├── autosave@0.14.0 | |
├── background-tips@0.15.0 |
A 01000001 | |
B 01000010 | |
C 01000011 | |
D 01000100 | |
E 01000101 | |
F 01000110 | |
G 01000111 | |
H 01001000 | |
I 01001001 | |
J 01001010 |
function truncate (str, start, end) { | |
str = str.replace(/^\s\s*/, '').replace(/(\r|\n)+/, '').replace(/\s\s*$/, ''); | |
var re = str.match(new RegExp('^.{' + (start || 0) + ',' + (end || 25) + '}[\S]*')); | |
var l = re[0].length; | |
var re = re[0].replace(/\s$/,''); | |
if (l < str.length) { | |
re += "…"; | |
} | |
return re; | |
} |
/Users/mashape/.atom/packages (68) | |
├── Stylus@0.3.1 | |
├── Sublime-Style-Column-Selection@1.1.3 | |
├── Watchmenesque-Dark@0.6.0 | |
├── abw-syntax@0.1.0 | |
├── api-blueprint-preview@0.2.2 | |
├── ask-stack@0.1.0 | |
├── atom-lint@0.20.0 | |
├── atom-spotify@0.6.1 (disabled) | |
├── atomatigit@1.0.0 |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns on recent CPU
L2 cache reference ........................... 7 ns 14x L1 cache
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs 4X memory
var util = require('util'); | |
function setCharAt (str, index, chr) { | |
return (index > str.length - 1) ? str : str.substr(0, index) + chr + str.substr(index + 1); | |
} | |
function normalizeHeaderName (headerName) { | |
var pieces = headerName.split('-'); | |
var length = pieces.length; | |
var index = 0; |
var os = require('os'); | |
var networkInterfaces = os.networkInterfaces(); | |
function getServerAddress () { | |
for (var name in networkInterfaces) { | |
var face = networkInterfaces[name]; | |
for (var i = face.length; i--;) { | |
var alias = face[i]; |
function parseResponseHeaderString (string) { | |
var output = {}; | |
var lines = string.split('\r\n'); | |
var status = lines.shift(); | |
function parseStatusLine (line) { | |
var pieces = line.split(' '); | |
var versionNumberPieces; | |
var versionPieces; |