Skip to content

Instantly share code, notes, and snippets.

View Francois-Esquire's full-sized avatar

Mike Tobia Francois-Esquire

View GitHub Profile
@Francois-Esquire
Francois-Esquire / multiplier.js
Created August 19, 2018 00:37
Node.js Cluster usage with simple worker delegation
const cluster = require('cluster');
const MULTIPLY_EVENT = 'multiply';
if (cluster.isMaster) {
(function run({ dataset, compare, length }) {
if (global.gc) global.gc();
const results = [];
@Francois-Esquire
Francois-Esquire / .zshrc
Last active May 22, 2018 22:01
loading ./node_modules/.bin on the fly | only possible with zsh terminals, avoids setting traps to cd, etc...
# for loading node module bin files into PATH
NPM_LOCAL_MODULES=/dev/null
function npm_bin_loader() {
CURRENT_NPM_MODULE=$NPM_LOCAL_MODULES
if [ -d "node_modules" ]
then
NPM_LOCAL_MODULES="$(pwd)/node_modules/.bin"
@Francois-Esquire
Francois-Esquire / buildSchema.js
Last active November 11, 2017 22:37
importing .graphql schema files with #import statements
const fs = require('fs');
const { graphql, buildSchema, introspectionQuery } = require('graphql');
const importSchema = require('./importSchema');
module.exports = async function buildSchemaDocument({
// schema.graphql
schemaPath,
// schema.json
outputPath,
@Francois-Esquire
Francois-Esquire / bash-cheatsheet.sh
Created January 15, 2017 03:28 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04