Skip to content

Instantly share code, notes, and snippets.

View routevegetable's full-sized avatar

Lee Marshall routevegetable

  • West Oakland, CA
View GitHub Profile
@routevegetable
routevegetable / Parser.java
Last active April 9, 2016 09:58
Monadic Java Parsers
/**
* Monadic Parsers for Java!
*/
public abstract class Parser<T> {
/**
* An example
*/
public static void main(String[] args) throws IOException {
@routevegetable
routevegetable / PropsInstantiator.java
Last active March 20, 2016 21:15
Instantiate an object graph from a property file
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
public class PropsInstantiator {
@routevegetable
routevegetable / css.css
Created March 5, 2016 20:07
Wibbly Fiddle
body{width:100%;background:black}
#bar{border:0;position:absolute;left:0;top:60px;height:30px;width:100%;background-color:green;z-index:10;opacity: 0.95;animation: example3 15s infinite linear;}
#foo11 { animation-delay:0s; }
#foo10 { animation-delay:-0.1s; }
#foo9 { animation-delay:-0.2s; }
#foo8 { animation-delay:-0.3s; }
#foo7 { animation-delay:-0.4s; }
#foo6 { animation-delay:-0.5s; }
#foo5 { animation-delay:-0.6s; }
#foo4 { animation-delay:-0.7s; }
@routevegetable
routevegetable / MQTTDataTypes.txt
Last active March 4, 2016 23:25
MQTT Data Types
Status: retained messages signalling the current state and liveness, republished any time and always on change.
Edge: definite change notifications (easily available from status)
Delta: stream of summary messages, summarizing a prior time slice.
Status messages convey liveness information via a heartbeat policy. A null message forces a status topic to 'expire'.
Edge topics are not retained.
Deltas can be aggregated arbitrarily via summing to make larger deltas.
Boolean and summable/averageable status messages convert trivially to deltas by assigning the time between two messages to the first message.
@routevegetable
routevegetable / a20_cec_ctl.sh
Last active May 14, 2016 22:56
Allwinner A20 CEC control script
#!/bin/bash
# Nasty script to poke the CEC control memory locations in Allwinner A20
# Find the STANDBY_VALUE we want
case $1 in
on)
STANDBY_VALUE=0
;;
off)