Skip to content

Instantly share code, notes, and snippets.

View HeinrichHartmann's full-sized avatar

Heinrich Hartmann HeinrichHartmann

View GitHub Profile
@HeinrichHartmann
HeinrichHartmann / markdown.css
Created December 15, 2013 14:15
Slightly customized version of Kevin Burke's markdown.css released under Apache License here https://bitbucket.org/kevinburke/markdowncss/overview http://kevinburke.bitbucket.org/markdowncss/markdown.css
/*
Customized version of Kevin Burke's markdown.css released under Apache License here
https://bitbucket.org/kevinburke/markdowncss/overview
*/
body{
margin: 0 auto;
@HeinrichHartmann
HeinrichHartmann / ZmqAppender.java
Created December 6, 2013 20:11
ZmqAppender for Log4j. Publishes log messages on a zmq socket.
package net.heinrich-hartmann.gists.ZmqAppender;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Layout;
import org.apache.log4j.SimpleLayout;
import org.apache.log4j.spi.LoggingEvent;
import org.jeromq.ZMQ;
/**
* ZmqAppender for Log4j.
@HeinrichHartmann
HeinrichHartmann / DistributedUrlDownloader.py
Created December 6, 2013 20:07
Distributed File Donwloader using ZMQ. List of urls is read from a file dstributed to workers, gathered and written to a directory.
#
# Distributed File Dowoloader
# ===========================
#
# List of urls is read from a file, distributed to workers, gathered and written to a directory.
#
# INSTALLATION & USAGE
# --------------------
# sudo apt-get install python-pip python-dev build-essential git screen
# sudo pip install pyzmq requests
@HeinrichHartmann
HeinrichHartmann / _G.lua
Last active August 29, 2015 14:15
Lua Global Environment
{
_G = nil --[[ref]],
_VERSION = "Lua 5.1",
arg = {
[-1] = "/usr/bin/lua",
[0] = "main.lua"
} --[[table: 0xbcbef0]],
assert = assert --[[function: 0xbc5310]],
collectgarbage = collectgarbage --[[function: 0xbc5370]],
coroutine = {
@HeinrichHartmann
HeinrichHartmann / sensor-server.py
Last active August 29, 2015 14:11
RaspberryPi Serving Sensor Data over HTTP
#!/usr/bin/env python
# Import the ADC driver:
# https://gist.github.com/HeinrichHartmann/27f33798d12317575c6c
import ADC0832 as ADC
import sys
import BaseHTTPServer
import json
from BaseHTTPServer import BaseHTTPRequestHandler
@HeinrichHartmann
HeinrichHartmann / TimeSeriesTools.py
Last active August 29, 2015 14:11
TimeSeries convenience functions
import numpy as np
import matplotlib.pylab as plt
from scipy import stats
from collections import *
from itertools import *
#
# Convenience Class for Time Series
#
# Series Objects can be added and subtracted using infix operators.
@HeinrichHartmann
HeinrichHartmann / blink.py
Last active August 29, 2015 14:10
Raspberry PI GPIO Tester
@HeinrichHartmann
HeinrichHartmann / hartmann.pub
Created November 16, 2014 17:15
GPG Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.4
Comment: Hostname: pgp.mit.edu
mQENBFLOhGwBCADLreJzn4F8bKodTjg/QY4AyvQQWxnM0h56xsUmqTZqvRCp9kgtrcR5Bnvp
kMMRoIx9rOM7Hnp/LrxogZ8ZHbp+r3eQt3tp8p7ZwymQCT8cZoreTQplDp4eqZmnPh4BMk3a
+gqvgPv5SShwQjNGtf8r31MWe+xTCx6Db1XYpHav0pSs06Gmf/Kh/WVMtTvh841R0OU9mWhk
OxnOYWDErPSzUolA9u4A20B3LVpowjoA5Oaq3kIzC+mgL7muXhiEA4hzL9WXqcDHPXyRS3ut
Djmz1oqXFIZFgwhUUDW6g1hyuVuulNZRMkFtqASi13x+qMF8PwbU6KvoVCXG9++yQF13ABEB
AAG0K0hlaW5yaWNoIEhhcnRtYW5uIDxoYXJ0bWFubkB1bmkta29ibGVuei5kZT6JAT4EEwEC
@HeinrichHartmann
HeinrichHartmann / account-summary.py
Created July 22, 2014 12:28
Bank Account Analytics for Sparda-Bank csv files
"""
Computes a summary of (unique) bank transactions from CSV files
USAGE:
python account-summary.py account_statment1.csv account_statement2.csv ...
OUTPUT:
CSV printed to stdout with the following colums
@HeinrichHartmann
HeinrichHartmann / wct.py
Last active August 29, 2015 14:03
WorldCupTime
#!/usr/bin/python
import sys
import BaseHTTPServer
import urllib2
from dateutil import parser, tz as dutz
from datetime import datetime, tzinfo
import ipdb
BREAK=ipdb.set_trace