Skip to content

Instantly share code, notes, and snippets.

@hsingh23
hsingh23 / app.js
Created May 7, 2018 14:30 — forked from edujr1/app.js
Clusterizar uma aplicação NodeJS de acordo com o numero máximo de processadores
const cluster = require('cluster');
const numCPUs = require('os').cpus().length;
const express = require('express');
const app = express();
module.exports = app;
cluster.on('exit', (worker, code, signal) => {
console.log(`Worker ${worker.process.pid} died with code: ${code}, and signal: ${signal}`);
console.log('Starting a new worker');
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.9a
@hsingh23
hsingh23 / gist:6444301
Last active December 22, 2015 08:19 — forked from hann2/gist:6443466
from string import split
class Table:
def __init__(self):
self.labels = []
self.data = []
def populate(self, file_name, col_delim="\t", row_delim="\n", data_start=None):
with open(file_name, 'r') as f:
if data_start: