Skip to content

Instantly share code, notes, and snippets.

View akoenig's full-sized avatar
🐝

André König akoenig

🐝
View GitHub Profile
@akoenig
akoenig / gist:1968061
Created March 3, 2012 20:32
node.js talk - dns resolver
/*
* DNS-Resolver with node.js
*
* Author: André König (andre.koenig@gmail.com)
*
*/
"use strict";
var dns = require('dns');
@akoenig
akoenig / gist:1968154
Created March 3, 2012 20:49
node.js talk - file reader
/*
* FileReader with node.js
*
* Author: André König (andre.koenig@gmail.com)
*
*/
"use strict";
var fs = require('fs');
@akoenig
akoenig / gist:1974181
Created March 4, 2012 18:04
node.js talk - http server
/*
* Small HTTP server with node.js
*
* Author: André König (andre.koenig@gmail.com)
*
*/
"use strict";
var http = require('http');
var dns = require('dns');
@akoenig
akoenig / package.json
Created March 4, 2012 18:58
node.js talk - twitter stream reader
{
"author": "Malte Legenhausen (mlegenhausen@gmail.com), John Philip Schnake (philipschnake@gmail.com), André König (andre.koenig@gmail.com)",
"name": "twitter-streamer",
"description": "A little app which receives tweets in realtime!",
"version": "0.0.1",
"homepage": "http://bremen.gtugs.com",
"repository": {
"url": ""
},
"engines": {
@akoenig
akoenig / gist:2473275
Created April 23, 2012 19:32
WebGL - Square
/*
* computer graphics
*
* Licensed under the MIT:
* http://www.opensource.org/licenses/mit-license.php
*
*
* Authors:
*
* Valentina Rotkin <vala.rot@googlemail.com>
@akoenig
akoenig / CS: Latency numbers
Last active October 5, 2015 17:37 — forked from jboner/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@akoenig
akoenig / randomfiles
Last active August 29, 2015 13:56
Little bash script which generates some random files (max file size ~3 MB).
#!/bin/bash
#
# randomfiles
#
# Little bash script which generates some random files (max file size ~3 MB).
#
# Copyright(c) 2014 André König <andre.koenig@posteo.de>
# MIT Licensed
#
@akoenig
akoenig / loc.js
Last active August 29, 2015 13:57
A super-duper-tiny LOC counter (with no external dependencies).
#!/usr/bin/env node
'use strict';
/**
*
* A super-duper-tiny LOC counter (with no external dependencies).
*
* Usage: loc "path" "extension-to-filter"
*
@akoenig
akoenig / docker
Created March 25, 2014 20:08
Debian init script for Docker
#!/bin/sh
### BEGIN INIT INFO
# Provides: docker
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Linux container runtime
# Description: Linux container runtime
#!/usr/bin/env node
/*
* dnsd
*
* Copyright(c) 2014 André König <andre.koenig@posteo.de>
* MIT Licensed
*
*/