Skip to content

Instantly share code, notes, and snippets.

@MonoidMusician
MonoidMusician / solver_performance.json
Created November 30, 2022 07:03
times in milliseconds, negative numbers for package versions that failed to solve
@MonoidMusician
MonoidMusician / sat_turing_machine.py
Last active March 6, 2025 16:39
So uhm, I wrote a sketch of a Turing Machine for SAT
# pseudo-assembly for a turing machine
# tape layout for SAT problem in nvar variables with CNF of length len
# (convenient to assume len >= nvar to make a single measure of complexity)
# we will be deleting clauses as we go, but otherwise the tape stays constant
# nvar variables, 3 bits each
nvar * <notSIGIL=0><mut mark=0><value>
# sigil separating variable table from CNF
<SIGIL=1>
module coefin.notarealagdafile where
-- This would be great syntax, but I don't think we can make it all implicit
------------------------------
-- Number/Numeral nonsense: --
------------------------------
-- `Fin` is an implicit coercion
#!/usr/bin/env python3
import re
import sys
# install this dependency from pip:
from wrapt import ObjectProxy
class FormattableMatch(ObjectProxy):
def __str__(self):
m = self.__wrapped__
@MonoidMusician
MonoidMusician / bug.py
Last active August 14, 2023 20:54
Weird bug(?) with fish not responding to SIGKILL
#!/usr/bin/env python3
import subprocess
from time import sleep
import sys
buggy = True
file = "'" + sys.argv[1] + "'"
p = subprocess.Popen(["fish" if buggy else "bash", "-c", "ffplay -nodisp -autoexit -hide_banner -loglevel error " + file])
@MonoidMusician
MonoidMusician / sugar.js
Created January 26, 2024 05:05
Silly little syntax sugars for JavaScript :3
// Silly little syntax sugars :3
// _.name({name:"hello"}) == "hello"
// mk.name("hello") == {name: "hello"}
// _pipe.join(", ").length.line_(["do", "re", "mi"]) == 10
// Create a simple proxy for syntactic sugar for method names and function calls
const sugar = (handler, applier=undefined) => new Proxy(applier ? ()=>{} : {}, {
get: (_target, property, _thisArg) => {
return handler(property);