Skip to content

Instantly share code, notes, and snippets.

@xTibor
xTibor / userscript.js
Last active April 19, 2024 14:04
window.status - A statusbar polyfill for browsing old websites
// ==UserScript==
// @name window.status
// @namespace http://tampermonkey.net/
// @version 2024-04-19
// @description A statusbar polyfill for browsing old websites
// @author Nagy Tibor <xnagytibor@protonmail.com>
// @match *://*/*
// @grant none
// ==/UserScript==
@xTibor
xTibor / main.rs
Last active September 3, 2023 18:55
Pixel art line slope normalization algorithm
#![feature(slice_group_by)]
fn line_slope_normalize(slope: &[usize]) -> Vec<usize> {
let mut slope = slope.to_owned();
slope.sort();
// [1, 2, 3, 4] => [2, 2, 3, 3]
loop {
let slope_before = slope.clone();

Tatami half-mat theorem:

For an N by N tatami-tiled room the maximum amount of half-mats that can be included while remaining auspicious is N.

Examples:

1
⊡

2
@xTibor
xTibor / jungle-exe-glitches.md
Created February 1, 2023 05:17
Timon & Pumbaa's Jungle Games - Glitches

Some undocumented glitches I found while tinkering with Timon & Pumbaa's Jungle Games:

Bug Drop

 1 2 3 4 5 
@xTibor
xTibor / jungle-exe-bytecode.txt
Last active January 29, 2023 21:06
Timon & Pumbaa's Jungle Games - Bytecode interpreter opcodes
Interpreter #1: FUN_1008_0C52
Interpreter #2: FUN_1008_C724
I#1 I#2 Opcode Function
0 1 0x01 ???
0 1 0x02 ???
0 1 0x03 ???
0 1 0x04 ???
0 1 0x05 ??? (JUNGS01)
0 1 0x06 ???
@xTibor
xTibor / jungle-exe-patch.md
Last active January 29, 2023 01:15
Timon & Pumbaa's Jungle Games - Fullscreen Fix for Wine/Proton

Timon & Pumbaa's Jungle Games - Fullscreen Fix for Wine/Proton

Checksum

  • File name: JUNGLE.EXE
  • Original MD5: A4BEFB3F94E9750AC19CE2FB037BB7A0
  • Patched MD5: 3590A725B439FF889E34BAFC9FF7248D

Patch

@xTibor
xTibor / logitech-g535.md
Last active December 8, 2022 17:52
Fix for Logitech G535 cutting out on Ubuntu-based distros

This issue is caused by fucking PulseAudio prematurely suspending output sinks. Open /etc/pulse/default.pa then comment out the module-suspend-on-idle module:

### Automatically suspend sinks/sources that become idle for too long
#load-module module-suspend-on-idle
@xTibor
xTibor / style.css
Last active November 16, 2022 19:03
Revert GitHub font change 2022/11/16
body, .markdown-body {
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";
}
$ timidity -iA -Os -B 2,9
$ aseqdump
$ aseqmatrix
aseqmatrix:
Passthrough -> timidity
Passthrough -> aseqdump
$ aplaymidi midi.mid --port 14:0
$ aseqdump --port 28:0
[Play button]
28:0 Control change 15, controller 106, value 127
28:0 Control change 15, controller 106, value 0
[Record button]
28:0 Control change 15, controller 107, value 127
28:0 Control change 15, controller 107, value 0