Skip to content

Instantly share code, notes, and snippets.

View mugli's full-sized avatar
🤷

Mehdi Hasan Khan mugli

🤷
View GitHub Profile
@mugli
mugli / README.md
Last active August 29, 2015 14:22 — forked from hofmannsven/README.md
@mugli
mugli / readme.md
Last active August 29, 2015 14:25 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@mugli
mugli / windows.h__.js
Last active August 29, 2015 14:25
windows.h.js INFINITY
var ffi = require('ffi'),
ref = require('ref'),
Struct = require('ref-struct'),
Library = require('./Library'),
Type = ref.Type,
NULL = ref.NULL,
isNull = ref.isNull;
var groups = ['libs', 'types', 'structs', 'callbacks', 'enums'];
/*
export default new GraphQLObjectType({
name: 'User',
description: 'A user',
fields: () => ({
first_name: {
type: GraphQLString,
description: 'The first name of the user.'
},
email: {
@mugli
mugli / roles_invesitgation.md
Created October 26, 2015 23:50 — forked from facultymatt/roles_invesitgation.md
Roles and permissions system for Nodejs
@mugli
mugli / install-comodo-ssl-cert-for-nginx.rst
Created October 27, 2015 06:45 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

Top Node.js metrics to watch: https://www.oreilly.com/ideas/top-nodejs-metrics-to-watch

The node.js Profiling Guide that Hasn’t Existed - Profiling node.js Applications - Part 1: http://www.willvillanueva.com/the-node-js-profiling-guide-that-hasnt-existed-profiling-node-js-applications-part-1/

The node.js Profiling Guide that Hasn’t Existed - Finding a potential memory leak using memwatch - Part 2: http://www.willvillanueva.com/the-node-js-profiling-guide-that-hasnt-existed-finding-a-potential-memory-leak-using-memwatch-part-2/

The node.js Profiling Guide that Hasn’t Existed - Finding The Cause of a Memory Leak Using Heap Snapshots - Part 3: http://www.willvillanueva.com/the-node-js-profiling-guide-that-hasnt-existed-finding-the-cause-of-a-memory-leak-using-heap-snapshots-part-3/

@mugli
mugli / nodejs-cluster-zero-downtime.md
Created April 19, 2016 13:10 — 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)

# Install
sudo apt install -y \
xvfb \
x11-xkb-utils \
xfonts-100dpi \
xfonts-75dpi \
xfonts-scalable \
xfonts-cyrillic \
x11-apps \
clang \
@mugli
mugli / xvfb
Last active May 23, 2016 17:00 — forked from dloman/xvfb
### BEGIN INIT INFO
# Provides: Xvfb
# Required-Start: $local_fs $remote_fs
# Required-Stop:
# X-Start-Before:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Loads X Virtual Frame Buffer
### END INIT INFO