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
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(); | |
} |
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
git clone -b <your_branch> --single-branch <your_repository_url> |
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
git clone -b <your_branch> --single-branch <your_repository_url> --depth <number_of_commits> |
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
git fetch <remote_name> <branch_name> | |
# or | |
git fetch --depth=<number_of_commits> <remote_name> <branch_name> |
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 exec = require('child_process').exec; | |
const { promisify } = require('util'); | |
const execAsPromise = promisify(exec); | |
const packageJson = require('./package.json'); | |
const commands = Object.entries(packageJson.peerDependencies) |
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
heroku config:set LOGGER_LEVEL=debug ENV=production CRYPTO_SECRET=guesswhat | |
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
heroku config >> config.txt | |
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
heroku config:set $(cat .env | sed '/^$/d; /#[[:print:]]*$/d') | |
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
heroku config | sed 's/: */=/g; /^=/d' >> .env | |
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
// tslint:disable-next-line:ban-types | |
export function once(fn: Function): Function { | |
let executed = false; | |
let result: any; | |
// tslint:disable-next-line:only-arrow-functions | |
return function() { | |
if (executed) { | |
return result; | |
} else { |
OlderNewer