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 / fish.lua
Created July 16, 2018 20:48
Computercraft fish
local fishStringL = "<'((>-<";
local fishStringR = ">-<))'>";
local fishLength = 7;
local foodDist = 5;
-- A float between -1 and 1
local randFloat = function()
return math.random(-100, 100) / 100;
@routevegetable
routevegetable / find-path.c
Last active November 14, 2017 22:54
Depth-first search on a 2D grid
/* Tries to find the shortest path to G */
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#define WIDTH 10
#define HEIGHT 10
const char grid[][WIDTH] =
@routevegetable
routevegetable / chip-deploy.sh
Last active January 28, 2017 23:07
A script to care of recompiling CHIP kernel & modules, and then rsyncing
#!/bin/bash
# Script to automate the stuff in http://www.raspibo.org/wiki/index.php/Compile_the_Linux_kernel_for_Chip:_my_personal_HOWTO
IP=192.168.0.24
MYDIR=`pwd`
BUILD_DIR=`pwd`/build
KVER=4.3.0bizarrefish+
set -e
@routevegetable
routevegetable / aoc-day-18.c
Created December 19, 2016 20:43
Advent of Code, Day 18
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <inttypes.h>
const char input[] = "^^^^......^...^..^....^^^.^^^.^.^^^^^^..^...^^...^^^.^^....^..^^^.^.^^...^.^...^^.^^^.^^^^.^^.^..^.^";
//const char input[] = ".^^.^.^^^^";
const uint64_t nrows = 100000000000;
@routevegetable
routevegetable / DuplicateFiles.cs
Last active August 29, 2016 13:54
Find Duplicate Files
using System;
using System.Threading;
using System.IO;
using System.Data.Linq;
using System.Linq;
using System.Collections.Generic;
using System.Security.Cryptography;
@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;
}
@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 / 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 / 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 / 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.