Skip to content

Instantly share code, notes, and snippets.

@tibawatanabe
tibawatanabe / git-clone-single-branch.bash
Last active July 13, 2017 21:50
git clone a single branch
git clone -b <your_branch> --single-branch <your_repository_url>
@tibawatanabe
tibawatanabe / spawn-node-process.js
Last active September 9, 2018 01:47
Node.js cluster example
const cluster = require('cluster');
if (cluster.isMaster) {
// Count the machine's CPUs
let cpuCount = require('os').cpus().length;
// Create a worker for each CPU
for (var i = 0; i < cpuCount; i += 1) {
startWorker();
}