Skip to content

Instantly share code, notes, and snippets.

View jcorbin's full-sized avatar

Joshua T Corbin jcorbin

View GitHub Profile
include <BOSL2/std.scad>
include <BOSL2/joiners.scad>
$eps = 0.01;
$fa = 4;
$fs = 0.2;
tolerance = 0.25;
stone_diameter = 380;
import test from 'ava';
/**
* deep object freeze that avoids the Readonly<{set foo()}> trap, and avoids
* needing to pull in something heavier like harden()
*
* @template {object} O
* @param {O} o
* @returns {O}
*/
@jcorbin
jcorbin / demo.js
Created July 17, 2021 13:30
problematic unicode
const data = 42;
console.log('such', data);
console.log('⋯', data);
console.log('more', data);
console.log('🤯', data);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcorbin
jcorbin / corrupt_test.js
Created November 10, 2020 20:33
simple markov-powered text corruptor
// @ts-check
/**
* Markov transition table on characters.
* Empty means "transparent", i.e let the underlying string through
*
* @typedef {Object<string, number>} Weights
* @typedef {Object<string, Weights>} Transitions
*/
package main
import "fmt"
// rooter is a base interface for example
type rooter interface {
root() int
}
// fooRooter is an example extension
### Keybase proof
I hereby claim:
* I am jcorbin on github.
* I am jcorbinwunjoorg (https://keybase.io/jcorbinwunjoorg) on keybase.
* I have a public key ASC8wyXqTJrIed_Lm63CtckzBiVCxM0vCTupyryY4WDjYAo
To claim this, I am signing this object:
@jcorbin
jcorbin / git-memo.sh
Last active March 28, 2020 17:07
git-memo
#!/bin/bash
set -e
# Memoizes a functionally pure command using git notes.
#
# Example:
#
# $ echo 'hello word' | git memo tr 'a-z' 'n-za-m'
# uryyb jbeq
import color
import texture
import imgui
import std
import vec
fatal(gl_window("Fail To Scale", 512, 512))
im_init(true)
check(im_add_font("data/fonts/Inconsolata/Inconsolata-Bold.ttf", 32), "cannot load imgui font")
package unzip
import (
"archive/zip"
"context"
"fmt"
"io"
"os"
"path/filepath"
"runtime"