Skip to content

Instantly share code, notes, and snippets.

View notwa's full-sized avatar
🚲
bikeshedding

Connor notwa

🚲
bikeshedding
View GitHub Profile
@notwa
notwa / halokey.c
Last active February 15, 2024 21:13
Halo CE product key, reverse engineered
/*
most of this code was reverse engineered from PidGen.dll, with hashes:
MD5: 3e275cb6c964ad9e3bffa3f37e1eef1e
SHA-1: 325d4bc9b603075ba96c48bfaf31588cb57026c6
SHA-256: 62361c9b86f7899d736986829d7a8529573e030c6656f04f3244f3b792a6b291
how to debug:
* ensure Halo is not installed OR temporarily rename the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Microsoft Games\Halo
* run the Halo CE installer off the CD
#!/usr/bin/env zsh
set -e
# private user stuff:
read -r oauth < ~/.twitch_oauth
# public api stuff:
api='https://gql.twitch.tv/gql'
ChannelFollowsHash='fd9d5312a69d3c50cd2a8d6a1caadc824df410c249b78d330d7f469d22151933'
ClipsCardsUserHash='b73ad2bfaecfd30a9e6c28fada15bd97032c83ec77a0440766a56fe0bd632777'
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@notwa
notwa / rsh.py
Created April 29, 2020 20:07
a random-sampling heuristic for optimization that usually works better than i'd like it to
#!/usr/bin/env python3
import numpy as np
# get this here: https://github.com/imh/hipsterplot/blob/master/hipsterplot.py
from hipsterplot import plot
def heuristic(costs, deltas, center_cost):
d = np.linalg.norm(deltas, axis=1)
c0 = costs[:, 0] - center_cost
@notwa
notwa / pokemon-swsh.csv
Last active December 30, 2019 16:14
Pokémon Gen 8: Sword & Shield Stats (scraped from serebii dot net)
id name form type1 type2 hp attack defense special_attack special_defense speed
1 Grookey Ordinary Grass None 50 65 50 40 40 65
2 Thwackey Ordinary Grass None 70 85 70 55 60 80
3 Rillaboom Ordinary Grass None 100 125 90 60 70 85
4 Scorbunny Ordinary Fire None 50 71 40 40 40 69
5 Raboot Ordinary Fire None 65 86 60 55 60 94
6 Cinderace Ordinary Fire None 80 116 75 65 75 119
7 Sobble Ordinary Water None 50 40 40 70 40 70
8 Drizzile Ordinary Water None 65 60 55 95 55 90
9 Inteleon Ordinary Water None 70 85 65 125 65 120
@notwa
notwa / stdio_hack.c
Created July 15, 2019 21:08
msvcrt stuff
/* WHAT: build code against the ancient Visual Studio 6.0 msvcrt.lib */
/* WHY: sizecoding; please refer to crinkler's manual.txt */
/* HOW: by replacing some of VS 14.0's definitions with VS 6.0's */
#define _NO_CRT_STDIO_INLINE 1
struct _iobuf {
char *_ptr;
int _cnt;
char *_base;
#!/usr/bin/env python3
# run like:
# python3 knapsack.py write | yices --logic=QF_BV | python3 knapsack.py read
from collections import namedtuple
# settings
# work our way up incrementally:
minimum_scores = (30000, 60000, 90000, 92000, 94000, 95000, 96000)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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