Skip to content

Instantly share code, notes, and snippets.

View teologov's full-sized avatar

Andrey Teologov teologov

View GitHub Profile
@teologov
teologov / nodejs-cluster-zero-downtime.md
Created February 14, 2017 13:27 — forked from jedi4ever/nodejs-cluster-zero-downtime.md
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@teologov
teologov / Build.md
Created November 30, 2016 11:01 — forked from robertknight/Build.md
Minimal Webpack DllPlugin example

Compile with:

webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js

Use with the following index.html

@teologov
teologov / Enhance.js
Created October 18, 2016 16:09 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@teologov
teologov / iterm2-solarized.md
Created February 21, 2016 09:37 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

@teologov
teologov / nginx.conf
Created December 29, 2015 13:42 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@teologov
teologov / .jshintrc
Created October 16, 2015 19:23 — forked from iliakan/.jshintrc
{
"maxerr": 25,
"latedef": "nofunc",
"browser": true,
"node": true, // for browserify require etc
"globals": ["$", "Prism", "describe", "it", "before", "after", "beforeEach", "afterEach"],
"indent": 2,
"camelcase": true,
"newcap": true,
"undef": true,
// Require libraries
var os = require("os");
var fs = require("fs");
var readline = require("readline");
var cluster = require("cluster");
var express = require("express");
var site = express();
// Var up, bro
var i, read;