Skip to content

Instantly share code, notes, and snippets.

View hwartig's full-sized avatar

Harald Wartig hwartig

View GitHub Profile
#!/usr/bin/env node
const parseInput = (input) => input.split('\n').map(line => line.split('-')).reduce((acc, [from, to]) => {
if (acc[from] == undefined) {
acc[from] = [to]
} else
acc[from].push(to)
if (acc[to] == undefined) {
acc[to] = [from]
@hwartig
hwartig / jupyter_notebook_config.py
Last active August 9, 2016 06:26 — forked from pjbull/jupyter_notebook_config.py
Create .py on save of Jupyter notebook
# Copy this file to ~/.jupyter/jupyter_notebook_config.py
import os
import shutil
from nbconvert.nbconvertapp import NbConvertApp
SAVE_PROGRESS_INDICATOR_FILE_PY = '.ipynb_save_py'
@hwartig
hwartig / StatsCollector.java
Created October 13, 2011 09:41
Collecting stats of a remote play server
package jobs;
import com.google.gson.JsonObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import play.Logger;
import play.Play;
import play.jobs.Every;
import play.jobs.Job;