View pentacoop.scad
module timber(l=8*12) {
linear_extrude(l)
polygon([
[.5,0],[3,0],
[3.5,1.75],
[3,3.5],[.5,3.5],
[0,1.75]]);
}
module timberr(x,y,z,r,o) {
View hexycoop.scad
module timber(l=8*12) {
linear_extrude(l)
polygon([
[.5,0],[3,0],
[3.5,1.75],
[3,3.5],[.5,3.5],
[0,1.75]]);
}
module timberr(x,y,z,r,o) {
View hexycoop.scad
module timber(l=8*12) {
linear_extrude(l)
polygon([
[.5,0],[3,0],
[3.5,1.75],
[3,3.5],[.5,3.5],
[0,1.75]]);
}
module timberr(x,y,z,r,o) {
rotate([0,0,r-90])
View promise-run.js
function run(iterator) {
return new Promise((resolve, reject) => {
var error, value, done;
next();
function next() {
while (!done) {
View storage.md

Level DB Style

This is highly influenced by https://github.com/google/leveldb#features

  • Keys and values are arbitrary byte arrays.
  • Data is stored sorted by key.
  • Callers can provide a custom comparison function to override the sort order.
  • The basic operations are Put(key,value), Get(key), Delete(key).
  • Multiple changes can be made in one atomic batch.
  • Users can create a transient snapshot to get a consistent view of data.
View vm.rust
#[derive(Debug)]
enum Value {
Nil,
Integer(i64),
String(usize),
Pair(usize)
}
#[derive(Debug)]
struct State {
View merger.lua
local concat = table.concat
-- Merger allows for effecient merging of many chunks.
-- The scan function returns truthy when the chunk contains a useful delimeter
-- Or in other words, when there is enough data to flush to the decoder.
local function merger(read, scan)
local parts = {}
-- Return a new read function that combines chunks smartly
return function ()
View line-decode.lua
local find = string.find
local sub = string.sub
local function decode(chunk)
local i = find(chunk, "\n", 1, true)
if not i then return end
return sub(chunk, 1, i - 1), sub(chunk, i + 1)
end
local function encode(line)
View large-grid.js
var neopixelWrite = require('ESP8266').neopixelWrite;
var count = 256;
var pixels = new Uint8Array(count * 3);
function update() {
neopixelWrite(14, pixels);
}
function dampen(p) {
var i = (p % count) * 3;
pixels[i]>>>=1;
pixels[++i]>>>=1;
View crawling-lights.js
length = 60 // Our strip has 60 LEDs
bpp = 3 // We are using normal ws2812b lights that expect 3 bytes of color.
delay = 33 // Delay between animation loops in ms (defaults to 100)
sprites = 4 // Total number of sprites to spawn at startup
fizz = 3 // How many sprites to update per animation loop (defaults to all)
// This is called once per animation loop before updating sprites.
loop {
fade(20)
}