Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua T Corbin jcorbin

View GitHub Profile
@jcorbin
jcorbin / corrupt_test.js
Created Nov 10, 2020
simple markov-powered text corruptor
View corrupt_test.js
// @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
*/
View extension_problems.go
package main
import "fmt"
// rooter is a base interface for example
type rooter interface {
root() int
}
// fooRooter is an example extension
View keybase proof
### 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:
View git-memo.sh
#!/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
View texscal.lobster
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")
View unzip.go
package unzip
import (
"archive/zip"
"context"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
View ex_book.txt
Title: "Madam Crowl'S Ghost Mystery Of Lonely Trails"
Supporting Docs:
- "The Rest Hollow Mystery"
- "The Yazoo Mystery"
- "Madam Crowl's Ghost and The Dead Sexton"
- "The Mystery of a Hansom Cab"
- "The Professor's Mystery"
- "Tales of Terror and Mystery"
- "The La Chance Mine Mystery"
View stdout.txt
2017/11/06 08:59:13 Kaksi
['\x00' '\x00'] => "c"
['\x00' 'c'] => "r"
['c' 'r'] => "e"
['r' 'e'] => "i"
['e' 'i'] => "l"
['i' 'l'] => "u"
['l' 'u'] => "e"
['u' 'e'] => "s"
['e' 's'] => "a"
View What have I done?
panic: net: inconsistent fdMutex
goroutine 1145194 [running]:
panic(0x126cc0, 0xc94cf02860)
/usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
net.(*fdMutex).RWLock(0xc8200620e0, 0x0, 0xc94d37f61e)
/usr/local/Cellar/go/1.6/libexec/src/net/fd_mutex.go:136 +0x20c
net.(*netFD).writeLock(0xc8200620e0, 0x0, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/net/fd_unix.go:194 +0x39
net.(*netFD).Write(0xc8200620e0, 0xc94cf02848, 0x7, 0x8, 0x0, 0x0, 0x0)
View gwr_bench_hang.txt
$ go test -c ./internal/marshaled
$ { sleep 5; pkill -QUIT marshaled.test }& # because timeout -s QUIT 5s ... doesn't correctly trigger a goroutine dump
$ ./marshaled.test -debug -numWatchers 1 -test.v -test.bench .
=== RUN TestDataSource_Watch_activation
--- PASS: TestDataSource_Watch_activation (0.00s)
PASS
BenchmarkDataSource_Watch_json-8 watcher[0] wants 1
put 0
wait for items
got "{\"i\":0,\"word\":\"the\"}"
You can’t perform that action at this time.