Skip to content

Instantly share code, notes, and snippets.

@fractal161
fractal161 / pasando.lua
Last active April 14, 2025 16:40
Passing Tetris in 7 Minutes
--[=[
PLANNING
- how to control piece sequence?
- information per execution unit:
- handler at the start of frame
- optionally controls piece movement according to another table
- handler right at end of piecegen
- special handler for first tetris because it does piecegen differently
- "extra" handlers, specify function and memory address
@fractal161
fractal161 / save_me.py
Created March 3, 2025 22:10
osu!lazer file recovery utility
'''
Tool for the very common situation where you mess with the osu lazer database
files (the ones you're told not to touch) without making a backup and suffer
the deserved consequences.
The interesting part here is that the files themselves are still present on
disk, but the lazer client is unable to perceive them (the existence of all
objects is tracked through client.realm). So the strategy here is to look for
all files after a certain cutoff date, pattern match for the desired file type,
then move them to one location, where they can be re-imported directly through
@fractal161
fractal161 / merge.py
Created May 5, 2024 07:45
VGO Part Merger
'''
Utility for merging orchestra parts in a printer-friendly manner
Motivation: print.mit.edu has an unfortunate quirk where only one document can
be uploaded at a time. This is quite inconvenient when printing a bunch of
orchestral parts because there are many instruments.
Only dependencies are python and the pypdf package. Its generic usage is of the
form
### Keybase proof
I hereby claim:
* I am fractal161 on github.
* I am fractal161 (https://keybase.io/fractal161) on keybase.
* I have a public key ASAuA3Cc7QuAdi6fimgmxEQDbxR6XBSDMmXWgZkc6K8lXAo
To claim this, I am signing this object:
@fractal161
fractal161 / all_uncap.py
Last active August 24, 2023 06:01
Generates bunch of score uncap codes for NES Tetris
letter_order = 'APZLGITYEOXUKSVN'
gg_order = [
['A', 'E', 'P', 'O', 'Z', 'X', 'L', 'U'],
['G', 'K', 'I', 'S', 'T', 'V', 'Y', 'N'],
]
# returns the two game genie codes associated with the given input
def create_code(addr, data, cmp=None):
indices = []
if cmp == None: