- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
The prep-script.sh will setup the latest Node and install the latest perf version on your Linux box.
When you want to generate the flame graph, run the following (folder locations taken from install script):
sudo sysctl kernel.kptr_restrict=0
# May also have to do the following:
# (additional reading http://unix.stackexchange.com/questions/14227/do-i-need-root-admin-permissions-to-run-userspace-perf-tool-perf-events-ar )
sudo sysctl kernel.perf_event_paranoid=0
- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git$ nano ~/.zshrc- Add
path=('/path/to/depot_tools' $path)
This file contains hidden or 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
| // Restify Server CheatSheet. | |
| // More about the API: http://mcavage.me/node-restify/#server-api | |
| // Install restify with npm install restify | |
| // 1.1. Creating a Server. | |
| // http://mcavage.me/node-restify/#Creating-a-Server | |
| var restify = require('restify'); |
- end-of-stream - specify a callback to be called when a stream ends (which is surpsingly hard to get right)
- duplexify - compose a Duplex stream from a Readable and a Writable stream
- pump - pipe streams together and close all of them if one of them closes
- pumpify - combine an array of streams into a single duplex stream using pump and duplexify
- through2 - tools for making Transform streams
- from2 - tools for making Readable streams
This file contains hidden or 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 | |
| replacements=( | |
| "NanAsyncWorker/Nan::AsyncWorker" | |
| "NanAsyncQueueWorker/Nan::AsyncQueueWorker" | |
| "NanCallback/Nan::Callback" | |
| "NanSetInternalFieldPointer/Nan::SetInternalFieldPointer" | |
| "NanGetInternalFieldPointer/Nan::GetInternalFieldPointer" | |
| "NanNewBufferHandle\\(([^;]+);/Nan::NewBuffer(\\1.ToLocalChecked();" | |
| "(NanNew(<(v8::)?String>)?\\(\"[^\"]*\"\\))/\\1.ToLocalChecked()" |
This file contains hidden or 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/sh | |
| set -x | |
| set -e | |
| # | |
| # Docker build calls this script to harden the image during build. | |
| # | |
| # NOTE: To build on CircleCI, you must take care to keep the `find` | |
| # command out of the /proc filesystem to avoid errors like: | |
| # | |
| # find: /proc/tty/driver: Permission denied |
This file contains hidden or 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 Hyperdrive = require('hyperdrive') | |
| var Level = require('level') | |
| var Swarm = require('discovery-swarm') | |
| var swarmDefaults = require('datland-swarm-defaults') | |
| // run this like: node thisfile.js 4c325f7874b4070blahblahetc | |
| var link = new Buffer(process.argv[2], 'hex') | |
| var LOCAL_PORT = Number(process.argv[3]) || 3282 // specify port or use 3282 | |
| var db = Level('./dat.db') |
OlderNewer