Skip to content

Instantly share code, notes, and snippets.

View routevegetable's full-sized avatar

Lee Marshall routevegetable

  • Berkeley, CA
View GitHub Profile
@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)
@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 / 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 / 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 / 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 / ChatterMonad-Java8.java
Last active April 23, 2016 19:07
A conversational free monad in java
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.function.Function;
public abstract class ChatterMonad<T> {
/**
* A result.
@routevegetable
routevegetable / ObjectConnection.java
Last active January 15, 2021 21:55
Remoting Experiment
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.HashMap;
@routevegetable
routevegetable / heat.html
Created May 14, 2016 22:57
Old Javascript wave simulation
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></head><body>
<canvas id="mycanvas" width="1000" height="500">Ma Canvas
</canvas>
<div>
Damping factor: <input type="text" id="ampScale" value="0.007"><br>
Wave speed: <input type="text" id="speed" value="200"><br>
Sine: <input type="checkbox" id="sine" defaultChecked="false"><br>
Cell Size (pixels): <input type="text" id="cellSize" value="10"><br>
Optimize: <input type="checkbox" id="opt" defaultChecked="false"><br>
Reflections: <input type="checkbox" id="findReflections" defaultChecked="false"><br>
@routevegetable
routevegetable / recipe.txt
Created May 14, 2016 22:59
Found this file. Potentially a cheesecake....?
2 tbsp coconut flour
3 tbsp almond flour
3 tbsp butter
1 large egg
1 tbsp cocoa powder
3 tbsp truvia
100g cream cheese
1 tsp vanilla
@routevegetable
routevegetable / Ticker.js
Last active May 14, 2016 23:09
Another file from my youth
function TickerEvent(time, obj) {
this.Time = time;
this.Obj = obj;
}
function TickerSpan(start, end, obj) {
this.Start = start;
this.End = end;
this.Obj = obj;
}