Skip to content

Instantly share code, notes, and snippets.

View notwa's full-sized avatar
🚲
bikeshedding

Connor notwa

🚲
bikeshedding
View GitHub Profile
@notwa
notwa / notwa.patch
Last active April 8, 2019 23:02
personal NullpoMino tweaks (no gameplay changes): patch -d src -p1 < notwa.patch
diff -ruN src.orig/mu/nu/nullpo/game/play/GameEngine.java src/mu/nu/nullpo/game/play/GameEngine.java
--- src.orig/mu/nu/nullpo/game/play/GameEngine.java 2019-04-03 01:42:36.841722400 +0200
+++ src/mu/nu/nullpo/game/play/GameEngine.java 2019-04-03 01:43:02.322620300 +0200
@@ -811,7 +811,7 @@
blockHidden = -1;
blockHiddenAnim = true;
- blockOutlineType = BLOCK_OUTLINE_NORMAL;
+ blockOutlineType = BLOCK_OUTLINE_NONE; // NOTE(notwa): hack!
blockShowOutlineOnly = false;
@notwa
notwa / everything
Last active September 20, 2021 08:03
coin-or stuff
#!/usr/bin/env bash
set -e
prefix="/opt/coin-or"
# get json2 for helping with github APIs later:
if [ ! -s "json2" ]; then
curl -LsS https://github.com/vi/json2/raw/master/json2 -o json2
fi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def expect_cossim(n, approx=True):
"""
returns gamma(n / 2) / gamma((n + 1) / 2) / sqrt(pi) for positive integers.
"""
assert n > 0
if approx:
# abs(error) < 1e-8
if n >= 128000:
return np.reciprocal(np.sqrt(np.pi / 2 * n + 1))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@notwa
notwa / lsca.uni.py
Last active January 20, 2019 07:41
#!/usr/bin/env python3
import sys
import numpy as np
def lament(*args, **kwargs):
return print(*args, file=sys.stderr, **kwargs)
@notwa
notwa / cc.txt
Last active November 2, 2018 16:50
// color combiner arguments:
// source | RGB | Alpha | official name
// | (a - b)* c + d | (A - B)* C + D |
// CC.COLOR_OUT | 0 0 0 0 | --- --- --- --- | COMBINED
// CC.COLOR_TEXEL_0 | 1 1 1 1 | --- --- --- --- | TEXEL0
// CC.COLOR_TEXEL_1 | 2 2 2 2 | --- --- --- --- | TEXEL1
// CC.COLOR_PRIM | 3 3 3 3 | --- --- --- --- | PRIMITIVE
// CC.COLOR_SHADE | 4 4 4 4 | --- --- --- --- | SHADE
// CC.COLOR_ENV | 5 5 5 5 | --- --- --- --- | ENVIRONMENT
// CC.KEY_CENTER | --- 6 --- --- | --- --- --- --- | CENTER
40c40
< 00000270: a040 009f 3c0e 8080 25ce 32f8 240f 2410 .@..<...%.2.$.$.
---
> 00000270: a040 009f 3c0e 8083 25ce df6c 240f 00e0 .@..<...%..l$...
# dead simple dictionary attack for fixed-length passwords.
# this is far from optimal.
from collections import defaultdict
import argparse
import sys
import random
program = sys.argv[0]
args = sys.argv[1:]
@notwa
notwa / names.txt
Last active January 7, 2020 12:53
Tony Hawk's Pro Skater 1 Tyr glitch names
AANGELEG -> HRFXKLYVFFB
AANGENOMENEN -> HRFXKNRIKZO
AANGEROL -> HRFXKRDKWTV
AANSTUIVING -> HRFIIVUPSXT
AANTRAD -> HRFJBNGVICJ
AARSKOERNING -> HRJVLROLITS
AARTSBRO -> HRJWHOVNTOG
AASE -> HRKWLPTIGOG
ABADIA -> HSH BLGXZSU
ABAISSERA -> HSHEKHWJVEX