Skip to content

Instantly share code, notes, and snippets.

View david-wm-sanders's full-sized avatar
🖋️
up late

David Sanders david-wm-sanders

🖋️
up late
View GitHub Profile
from dataclasses import dataclass
from pathlib import Path
import xml.etree.ElementTree as XmlET
import bpy
STEAMLIB_DIR = """C:\Program Files (x86)\Steam"""
PACKAGE_NAME = "vanilla"
@david-wm-sanders
david-wm-sanders / model.py
Last active October 17, 2022 04:24
Load a RWR voxel model into Blender
from dataclasses import dataclass
from pathlib import Path
import xml.etree.ElementTree as XmlET
import bpy
STEAMLIB_DIR = """C:\Program Files (x86)\Steam"""
PACKAGE_NAME = "vanilla"
@david-wm-sanders
david-wm-sanders / voxel-recolourer.py
Created October 15, 2022 14:50
Recolour a RWR voxel model
import sys
import xml.etree.ElementTree as XmlET
from pathlib import Path
from statistics import fmean
if __name__ == '__main__':
if (l := len(sys.argv)) != 2:
print(f"Error: incorrect number of parameters provided: expected 1, got {l-1}")
sys.exit(1)
@david-wm-sanders
david-wm-sanders / sanitise.py
Created July 17, 2022 14:34
Sanitises a folder of RWR profiles
import sys, time, hashlib, zipfile
from collections import Counter
from pathlib import Path
import xml.etree.ElementTree as XmlET
script_dir = Path(__file__).parent
salt_file = script_dir / "salt.txt"
salt_info = "A salt is required for the hash function used to protect the player SIDs.\n" \
"This salt must remain constant once set in order for alts to be coalesced " \
@david-wm-sanders
david-wm-sanders / genpyi_example.txt
Created June 15, 2022 00:42
PySide6 command to regen .pyi stubs for snake_case and/or true_property features
pyside6-genpyi all --feature snake_case true_property
@david-wm-sanders
david-wm-sanders / rwr_settings_snippet.xml
Last active June 16, 2022 17:38
RWR settings.xml controls explained
<keyboard_controls>
<!-- UP: W (0x11) -->
<control0 value="17" />
<!-- DOWN: S (0x1F) -->
<control1 value="31" />
<!-- LEFT: A (0x1E) -->
<control2 value="30" />
<!-- RIGHT: D (0x20) -->
<control3 value="32" />
<!-- RELOAD: R (0x13) -->
import sys
import xml.etree.ElementTree as XmlET
from pathlib import Path
if __name__ == '__main__':
if (l := len(sys.argv)) != 3:
print(f"Error: incorrect number of parameters provided: expected 2, got {l-1}")
sys.exit(1)
# Deprecated - see https://github.com/david-wm-sanders/twitchget
"""twitchget
Usage: twitchget.py <target> <download_dir>
"""
import shutil
import sqlite3
import subprocess
from pathlib import Path
"*":
core:
customFileTypes:
"text.html.jinja": [
"html"
]
...
...