Skip to content

Instantly share code, notes, and snippets.

View jongwook's full-sized avatar

Jong Wook Kim jongwook

View GitHub Profile
@jongwook
jongwook / guitar.ino
Created June 9, 2014 19:03
Arduino MIDI guitar
#include <SoftwareSerial.h>
SoftwareSerial midi(2, 3);
// there are 6 strings
#define STRINGS 6
// and 5 frets available
#define FRETS 5
// input pins
@jongwook
jongwook / amazon-free-tier.txt
Last active October 1, 2023 07:13
UnixBench results for various virtual hosting environments
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: ip-172-31-43-143: GNU/Linux
OS: GNU/Linux -- 3.14.35-28.38.amzn1.x86_64 -- #1 SMP Wed Mar 11 22:50:37 UTC 2015
Machine: x86_64 (x86_64)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz (5000.1 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
13:44:50 up 43 min, 2 users, load average: 0.78, 0.62, 0.33; runlevel 3
@jongwook
jongwook / ZooKeeper.java
Last active January 2, 2016 02:19
Code snippet - wrapping Apache Curator's APIs with RxJava
import static com.google.common.collect.Lists.transform;
import static java.nio.charset.StandardCharsets.UTF_8;
import static rx.Observable.from;
import static rx.Observable.merge;
public Observable<String> watch(String path) {
return Observable.create(observer -> {
AtomicBoolean unsubscribed = new AtomicBoolean(false);
@jongwook
jongwook / industry.cpp
Last active December 26, 2015 08:39
Trying to reproduce Yuji Ijiri's 1964 paper about business firm growth and size
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <algorithm>
#include <vector>
static const int SESSIONS = 10000;
static const double ALPHA = 0.25;
static const double BETA = 0.95;