Skip to content

Instantly share code, notes, and snippets.

View mincrmatt12's full-sized avatar

Matthew Mirvish mincrmatt12

View GitHub Profile
@mincrmatt12
mincrmatt12 / craptype.py
Created November 27, 2022 21:49
craptype
import evdev
import curses
import string
import random
import math
import sys
import copy
import time
from selectors import DefaultSelector, EVENT_READ
#lang lazy
(require "Lambda.rkt")
; (provide (all-defined-out))
; note to self: remember to replace this with an actual constant
; (define basic-cutoff (NAT (sub1 (expt 2 (quotient 64 2)))))
(define basic-cutoff (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True (Cons True Empty)))))))))))))))))))))))))))))))))
(define (adv-co co)
@mincrmatt12
mincrmatt12 / varproxy.py
Created October 19, 2021 19:20
evil bytecode hackery in python pt1: getting around libraries that require positional arguments
import dis
import types
_INSN = type("INSN", (), {x: (lambda arg=0, y=y: bytes((y, arg))) for x, y in dis.opmap.items()})
_CFN = {y: x for x, y in dis.COMPILER_FLAG_NAMES.items()}
def build_proxy_to(fn, nargs):
"""
Do evil magic to build a function object of signature fn(x0, x1, ..., xnargs) which calls fn(*x)
"""
@mincrmatt12
mincrmatt12 / jtest.cpp
Created November 8, 2020 01:34
MSign json tester
#include "json.h"
#include <iostream>
void show_stack(json::PathNode &pn) {
if (pn.is_root()) {
std::cout << "(root)";
return;
}
std::cout << pn.name;
if (pn.is_array()) {
"""
fixes idle by creating another shortcut with the name "realidle" that _really works_ 100% money back guaratee
this product is copyright (c) oo matthew under the WTFPL
"""
nongmoscript = r"""@echo off
set HOMEDRIVE=C:
set HOMEPATH=\Users\%USERNAME%
start pythonw -m idlelib.idle
@mincrmatt12
mincrmatt12 / fit.py
Last active September 14, 2019 18:26
fit thingy
import math
"""
routines:
- fit spline (compute x_dot and x_dot_dot)
- interpolate_with_spline (compute full range of x, x_dot, x_dot_dot from spline output for visualization)
- init_times (compute times from velocity mins/maxs) max accel will limit this further
"""
/summon MinecartCommandBlock ~ ~1 ~ {Command:kill @e[type=MinecartCommandBlock,r=1],Riding:{id:MinecartCommandBlock,Command:setblock ~ ~-1 ~1 redstone_block,Riding:{id:MinecartCommandBlock,Command:setblock ~ ~ ~1 command_block 0 replace {Command:fill ~ ~-3 ~-1 ~ ~ ~ air},Riding:{id:MinecartCommandBlock,Command:"scoreboard objectives add qFUgq_I dummy",Riding:{id:MinecartCommandBlock,Command:"tellraw @p [\"\",{\"text\":\"[Portals]\",\"color\":\"light_purple\",\"underlined\":true},{\"text\":\" Please do not take credit for this command\",\"color\":\"green\",\"underlined\":false}]",Riding:{id:MinecartCommandBlock,Command:"tellraw @p [\"\",{\"text\":\"[Portals]\",\"color\":\"light_purple\",\"underlined\":true},{\"text\":\" Portals by mincrmatt12 is being installed.\",\"color\":\"gold\",\"underlined\":false}]",Riding:{id:MinecartCommandBlock,Command:"scoreboard players set ni2 tpd_a 1",Riding:{id:MinecartCommandBlock,Command:"scoreboard players set ni tpd_a 1",Riding:{id:MinecartCommandBlock,Command:"scoreboard ob