Skip to content

Instantly share code, notes, and snippets.

View sansmischevia's full-sized avatar

Bryant Chou sansmischevia

  • Webflow
  • San Francisco, CA
View GitHub Profile

Minimum Viable Async with Node 6

With the release of Node 6.0.0, the surface of code that needs transpilation to use ES6 features has been reduced very dramatically.

This is what my current workflow looks like to set up a minimalistic and fast microservice using micro and async + await.

The promise

@lkarsten
lkarsten / default.vcl
Last active April 23, 2021 18:32
varnish vcl for ghost blogging platform
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
@sansmischevia
sansmischevia / mockDynamo.js
Created January 8, 2013 20:49
A mock dynamo client that helps unit testing.
var DATABASE = {};
/**
* Start awk-sdk mock
*/
exports.getItem = function(params, cb) {
if (params.AttributesToGet) {
var ret = {
Item: {}
};
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
@Iristyle
Iristyle / install-graphite-ubuntu-11.10.sh
Created November 12, 2011 18:40
Install Graphite 0.9.9 on Ubuntu 11.10 on EC2 with NGinx, uwsgi, supervisord, statsite, nagios agent
#!/bin/bash
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# Forked from: http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Ubuntu 11.10 Oneiric Ocelot
# Forked from https://gist.github.com/1287170
# Modified to use NGinx + uwsgi instead of Apache, as well as memcached and supervisord, incorporating ideas from
# http://blog.adku.com/2011/10/scalable-realtime-stats-with-graphite.html