Skip to content

Instantly share code, notes, and snippets.

View nanthanwa's full-sized avatar

Nan Thanwa nanthanwa

  • Chiang Mai, Thailand
View GitHub Profile
@nanthanwa
nanthanwa / Gulpfile.js
Created November 19, 2015 20:57 — forked from webdesserts/Gulpfile.js
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@nanthanwa
nanthanwa / app.js
Created January 25, 2016 10:17 — forked from sogko/app.js
gulp + expressjs + nodemon + browser-sync
'use strict';
// simple express server
var express = require('express');
var app = express();
var router = express.Router();
app.use(express.static('public'));
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
@nanthanwa
nanthanwa / promises.js
Created February 2, 2016 15:44 — forked from danthareja/promises.js
A conjurer's guide to promises
/*
* A quick example of how to use Bluebird and Q to conjure your own promises
*
* Everything going on here is explained further in the following video:
* http://youtu.be/OU7WuVGSuZw?list=PLT-DLWOBKbB4dZ83I_7Ca-sUTvorckG-E
*
*/
// Import node modules
var Q = require('q');
@nanthanwa
nanthanwa / README.md
Created May 23, 2017 16:54 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation

Keybase proof

I hereby claim:

  • I am nanthan on github.
  • I am thanwa (https://keybase.io/thanwa) on keybase.
  • I have a public key ASDoD4Gzws5CklvWp_XI2fcCbpphX1PBna7U2Lt1zp0moQo

To claim this, I am signing this object:

GRPC REST
Protocol Buffers - smaller and faster JSON - text ased - slower and bigger
HTTP/2 (lower latency) - from 2015 HTTP/1.1 (higher latency) from 1997
Bidirectional & Async Client => Server requests only
Stream Support Request/ Response support only
API Oriented - What (no constraints - free design) CRUD Oriented (Create - Retrive - Update - Delete / GET POST PUT DELETE)
Code Generation through Protocol Buffers in any language 1st class citizen Code feneratiion through OpenAPI / Swagger (add-on) - 2nd class citizen
RPC Based - gRPC does the plumbing for us HTTP verbs based - we have to write the plumbing or use a 3rd party library
@nanthanwa
nanthanwa / sonarqube-docker-compose.yml
Created July 1, 2019 05:17 — forked from Warchant/sonarqube-docker-compose.yml
docker-compose file to setup production-ready sonarqube
version: "2"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks:
@nanthanwa
nanthanwa / docker-ganache
Created August 27, 2019 10:41
docker-compose.yml for ganache-cli
version: '3.3'
services:
ganache-cli:
container_name: ganache-cli
image: trufflesuite/ganache-cli:latest
ports:
- 8545:8545
restart: always

Keybase proof

I hereby claim:

  • I am nanmcpe on github.
  • I am thanwa (https://keybase.io/thanwa) on keybase.
  • I have a public key whose fingerprint is B362 4538 AC34 4D9D A4B0 61A0 E39E CB8A FA78 040B

To claim this, I am signing this object:

#------------------------------------------------------------------------------
# solidity.rb
#
# Homebrew formula for solidity. Homebrew (http://brew.sh/) is
# the de-facto standard package manager for OS X, and this Ruby script
# contains the metadata used to map command-line user settings used
# with the 'brew' command onto build options.
#
# Our documentation for the solidity Homebrew setup is at:
#