Skip to content

Instantly share code, notes, and snippets.


Ruben Deyhle deyhle

View GitHub Profile
malko / makeTemplate.js
Created Mar 21, 2017
dynamic es6 template string to template methods
View makeTemplate.js
//const tpl = makeTemplate('hello ${name}')
//const name = 'world';
const makeTemplate = (templateString) => {
return (templateData) => new Function(`{${Object.keys(templateData).join(',')}}`, 'return `' + templateString + '`')(templateData);
jdxcode / boot.js
Last active Nov 11, 2020
zero-downtime node.js app runner
View boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run
You can’t perform that action at this time.