Skip to content

Instantly share code, notes, and snippets.

View heinermann's full-sized avatar
😺
Hello

Adam Heinermann heinermann

😺
Hello
View GitHub Profile
@heinermann
heinermann / Decompress.cpp
Last active March 6, 2024 14:22 — forked from ogarvey/Decompress.cpp
Decompiled Tetris Decompress method
#define g_p_BOLTcursor (*(byte **)(unaff_A5 + -0x15f0))
#define g_BOLT_bytes_available (*(int *)(unaff_A5 + -0x15f8))
#define NEXT_BYTE(r) nBytesAvailable--;\
if (nBytesAvailable < 0) { NextBlock(); pData = g_p_BOLTcursor; nBytesAvailable = g_BOLT_bytes_available; }\
r = *pData++;
byte * Decompress(byte *pResult, uint result_filesize, ushort flags)
{
@heinermann
heinermann / index.sh
Created February 18, 2024 08:32
Post-processed CMU Graphics Lab Motion Capture Database sorting script
# MoCap directory sorting script
# For https://rancidmilk.itch.io/free-character-animations
# Which uses the following MoCap database: http://mocap.cs.cmu.edu/
TARGETDIR="Subject #1 (climb, swing, hang on playground equipment)"
mkdir "$TARGETDIR"
mv 01_01.glb "$TARGETDIR/01_01 playground - forward jumps, turn around.glb"
mv 01_02.glb "$TARGETDIR/01_02 playground - climb.glb"
@heinermann
heinermann / d2rcmdline
Last active October 5, 2023 05:20
D2R Command Line Options
-w, -window, -windowed Run in windowed mode.
-per ??
-lq Runs game using low quality/low vision mode; same as Large Font Mode setting.
-gamma <num> Override Gamma. Default: 0
-vsync <num> Override VSync. Default: 255
-aftermath <string> ?? 23 chars max. Default: unset
-s <string> ?? 23 chars max. Default: unset
-gametype <num> ?? Default: 0
-arena <num> ?? Default: 0
-joinid <num> ?? Default: 1
@heinermann
heinermann / mats_to_wiki.py
Last active January 30, 2023 22:07
Noita materials to wiki infobox generator
import xml.etree.ElementTree as ET
import csv
import re
import png
import networkx as nx
import itertools
import yaml
import glob
from pathlib import Path
from PIL import Image, ImageDraw, ImageEnhance
@heinermann
heinermann / trig_overlap_check.cpp
Last active January 9, 2020 08:40
BW trigger overlap checker - gets byte count for perfect repeating overlaps
#include <bitset>
#include <iostream>
// 2740 bytes per overlapped read/write triggers
constexpr int OVERLAP_BYTES = 2740 * 4;
using TrigSet = std::bitset<OVERLAP_BYTES>;
TrigSet trigBase;
void initTriggerUse() {
@heinermann
heinermann / x.cpp
Created December 15, 2019 23:48
BWRegionGen in BWAPI
#include <vector>
#include <cstdint>
#include <cassert>
#include <array>
#include <algorithm>
#include <BWAPI/Game.h>
#include <BWAPI/Position.h>
template<typename utype>
@heinermann
heinermann / rew_gcal.js
Last active August 5, 2019 22:27
Rew Open House Google Calendar Integration
// ==UserScript==
// @name Rew Google Calendar Integration
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Add Open House dates for a listing to your google calendar
// @author Adam Heinermann
// @match https://www.rew.ca/properties/*
// @grant none
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/datejs/1.0/date.min.js
@heinermann
heinermann / PathingX.cpp
Last active August 2, 2018 07:14
regions_create
#include "PathingX.h"
#include "BWAPI/GameImpl.h"
#include <cassert>
#include <utility>
#include <algorithm>
regions_t regions;
using namespace BWAPI;
@heinermann
heinermann / memcpyIP.c
Last active September 19, 2016 04:03 — forked from MichaelNecio/memcpyIP.c
Problem of the Week 1, What's up with compilers?
#include <string.h>
#include <stdio.h>
#include <stdint.h>
int main() {
uint32_t ip;
scanf("%u", &ip);
uint8_t octets[4];
world.logInfo("THIS IS TRUE (100% tested)--> " .. tostring(run_install_script))
if ( run_install_script == true ) then
world.logInfo("THIS DOESN'T HAPPEN")
o.parser:run_install_script()
else
world.logInfo("THIS HAPPENS INSTEAD")
o.parser:stop()
end