Skip to content

Instantly share code, notes, and snippets.

View pid's full-sized avatar

Sascha pid

  • Baden-Württemberg, Germany
View GitHub Profile
@pid
pid / Readme.md
Last active October 13, 2016 06:16 — forked from rauchg/Readme.md
Minimum Viable Async with Node 6

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

@pid
pid / a.js
Created September 23, 2016 10:37 — forked from isaacs/a.js
var Module = require('module')
Module.prototype.require = function (orig) { return function (id) {
console.trace(this, id)
return orig.apply(this, arguments)
}}(Module.prototype.require)
require('./b.js')
@pid
pid / homebrew-fix.sh
Created September 26, 2014 12:52
re-link all the installed packages
#!/bin/bash
FORMULAS=(`brew list`);
for FORMULA in "${FORMULAS[@]}"
do
echo "brew unlink $FORMULA" && echo "brew link $FORMULA";
OUTPUT=`brew unlink $FORMULA`;
echo $OUTPUT;
OUTPUT=`brew link $FORMULA`;
echo $OUTPUT;
done
@pid
pid / config.fish.sh
Created April 19, 2016 11:26 — forked from victorporof/config.fish.sh
config.fish
# Fish 2.0 config
# Enviroment setup
clear
set -x NODE_PATH /usr/local/lib/node_modules
set -x PATH /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/local/share/npm/bin $NODE_PATH
set -e fish_greeting
@pid
pid / introrx.md
Created March 22, 2016 12:47 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@pid
pid / info.plist
Created January 8, 2016 12:50 — forked from mlynch/info.plist
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@pid
pid / LICENSE.txt
Created January 27, 2014 20:37 — forked from jed/LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE

Overview

We run multiple server processes in two data centers. Each process listens on two ports, one for HTTP and one for HTTPS. HTTPS is terminated by Apache prior to reaching node.js. HTTP goes directly from the client to node.js (through a master load balancer). We do not use clusters. We slice our physical servers into thin virtual machines running SmartOS, each with about 3GB of memory designed for a single node.js process.

Our node.js servers are hapi.js servers using the composer functionality and plugins architecture. We have three sets of plugins loaded: mobile web front end experience (single page app), legacy API reverse proxy, and monitoring.

We also serve original node.js services off another server zone which runs closed source plugins using hapi.

Analytics

// jshint devel: true
// make a copy of each `console` methods and adds them
// to the global object so that you can call `log('foobar')`
// instead of the verbose `console.log('foobar')`
// DO NOT USE IT IN PRODUCTION MODE
// @623HS
(function(global) {
'use strict';
var name, value;
@pid
pid / install-nodejs.sh
Created January 12, 2014 16:17
install nodejs on raspberry pi
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install git-core build-essential python libssl-dev
sudo git config --global http.sslVerify false
cd /opt
sudo git clone https://github.com/joyent/node.git
cd node
sudo git checkout v0.10.24
sudo ./configure
sudo make