Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chemdemo's full-sized avatar
👨‍💻
Happy coding

衍良 chemdemo

👨‍💻
Happy coding
View GitHub Profile
@ManzDev
ManzDev / rollup.config.js
Created February 24, 2018 17:13
RollUp Config file for easy ES6 to ES5 bundle
import babel from 'rollup-plugin-babel';
import eslint from 'rollup-plugin-eslint';
import resolve from 'rollup-plugin-node-resolve';
import multiEntry from 'rollup-plugin-multi-entry';
import uglify from 'rollup-plugin-uglify';
import filesize from 'rollup-plugin-filesize';
import commonjs from 'rollup-plugin-commonjs';
import progress from 'rollup-plugin-progress';
let pluginOptions = [
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@atimb
atimb / agent.js
Last active May 16, 2023 12:20
Real keep-alive HTTP agent for node.js
/**
* Real keep-alive HTTP agent
*
* ------------=================----------------
* UPDATE: There are more proper implementations for this problem, distributed as
* npm modules like this one: https://github.com/TBEDP/agentkeepalive
* ------------=================----------------
*
* The http module's agent implementation only keeps the underlying TCP
* connection alive, if there are pending requests towards that endpoint in the agent
@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh