Skip to content

Instantly share code, notes, and snippets.

View mrowrpurr's full-sized avatar

Mrowr Purr mrowrpurr

View GitHub Profile
@mrowrpurr
mrowrpurr / publish.css
Created June 28, 2024 22:27 — forked from zsviczian/publish.css
Excalidraw Obsidian Publish Support
@font-face {font-family: "Virgil";src: url("https://excalidraw.com/Virgil.woff2");}
@font-face {font-family: "Cascadia";src: url("https://excalidraw.com/Cascadia.woff2");}
@font-face {font-family: "Assistant";src: url("https://excalidraw.com/Assistant-Regular.woff2");}
div.markdown-embed-title {
display: none;
}
div.markdown-embed {
border: none;
@mrowrpurr
mrowrpurr / Fallout 2 - Tile Mask.cpp
Created May 8, 2024 02:02
Fallout 2 - Tile Mask
void generate_blue_tile_mask_struct() {
QImage mask(":/tile_mask.png");
std::vector<std::pair<uint8_t, uint8_t>> tilePixelCoordinates;
for (int y = 0; y < mask.height(); ++y) {
for (int x = 0; x < mask.width(); ++x) {
QRgb pixel = mask.pixel(x, y);
if (qAlpha(pixel) != 0) { // Check if the pixel is not transparent
tilePixelCoordinates.push_back({static_cast<uint8_t>(x), static_cast<uint8_t>(y)});
}
}
def rename_fn(name, offset):
print("Offset " + hex(offset) + ", Name " + name)
func = currentProgram.getFunctionManager().getFunctionAt(getAddress(offset))
if func:
func.setName(name, ghidra.program.model.symbol.SourceType.DEFAULT)
else:
print("Creating function...")
cmd = ghidra.app.cmd.function.CreateFunctionCmd(getAddress(offset))
if cmd.applyTo(currentProgram):
print("Created function.")
import argparse
import os
from pathlib import Path
from typing import List
import shutil
# Default output directory placeholder
default_out: str = "xmake_libraries"
# Default package names list
import base64
# Python port of .NET's HttpServerUtility.UrlTokenDecode
def url_token_decode(encoded_string: str) -> bytes:
# Get the padding count from the last character of the encoded string
padding_count = ord(encoded_string[-1]) - ord("0")
# Remove the last character (which indicates padding)
encoded_string = encoded_string[:-1]
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
@mrowrpurr
mrowrpurr / Qt compile_commands watcher.py
Created May 21, 2023 02:03
Qt compile_commands watcher
# Watch the compile_commands.json file and, whenever it changes, remove any moc_*.cpp files
#
# Requirements: pip install watchdog
import sys
import os
import json
import time
from time import sleep
from watchdog.observers import Observer
@mrowrpurr
mrowrpurr / _ vcpkg registry manager _.md
Last active April 21, 2023 15:46
vcpkg registry manager (for GitHub)

vcpkg registry manager

for GitHub!

Installation

Copy registry.py into the root of any GitHub repository

Oh, and you'll need Python 3!

class MatchesRegexMatcher {
std::vector<std::string> _patterns;
public:
template <typename... Args>
MatchesRegexMatcher(std::string pattern, Args... args) : _patterns({pattern, args...}) {}
const std::vector<std::string>& GetPatterns() const { return _patterns; }
bool Matches(const std::string& text) const {