Skip to content

Instantly share code, notes, and snippets.

@minexew
minexew / fixheader.py
Created July 29, 2014 20:45
/gd/ is pretty cool
# usage: fixheader.py <valid_bmp> <file_to_fix>
HEADER_SIZE = 54
import sys
header = sys.argv[1]
fileName = sys.argv[2]
with open(header, 'rb') as input, open(fileName, 'rb+') as output:
// Renderer.hpp
class ShaderGlobal {
public:
ShaderGlobal(const char* name) {
this->handle = Rend::CreateShaderGlobal(name);
}
template <typename T>
void operator = (const T& value) {
#!/usr/bin/env python
#usage: build-package-list.py <directory>
from __future__ import print_function
import os
import sys
DIR = sys.argv[1]
import os
for f in sorted(os.listdir("AllModel")):
if f.endswith(".mtl"):
with open(f"AllModel/{f}", "rt") as file:
for line in file:
if line.startswith("\tmap_Kd "):
texture = line.rstrip()[-6:]
print(f"INSERT INTO \"model_texture\" VALUES('Stalker','{f.replace('mtl', 'mbac')}','{texture}');")
break
@minexew
minexew / rarbg-sub-fix.py
Last active February 20, 2024 09:52
RARBG subtitle fixer for media player compatibility
"""
RARBG subtitle fixer for media player compatibility
Migrates subtitles from a directory structure like this:
Show Title
├── Season 01
│ ├── Subs
│ │ ├── S01E01
│ │ │ └── 3_English.srt