Skip to content

Instantly share code, notes, and snippets.

View szapp's full-sized avatar

Sören Zapp szapp

View GitHub Profile
@szapp
szapp / DaedalusBenchmark.d
Last active August 10, 2025 12:31
Daedalus performance benchmark (PBM) to compare two implementations (e.g. Daedalus vs. machine code) based on MEM_Benchmark.
/*
* Performance benchmark (PBM) to compare two implementations (e.g. Daedalus vs. machine code) based on MEM_Benchmark.
* Adjust the implementations `pbm_impl_A` and `pbm_impl_B` and compare their performance with `pbm_run()`.
*/
const int pbm_loop_num = 10000;
func int pbm_impl_A() {
// Example: Loop that sums all numbers (Daedalus)
var int sum; sum = 0;
repeat(i, pbm_loop_num); var int i;
@szapp
szapp / kbx_to_protonpass.py
Last active August 11, 2025 23:41
Keep tags and the hierarchical organization of nested groups when migrating from KeePassXC to ProtonPass
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "cyclopts",
# ]
# ///
import logging
import sys
@szapp
szapp / DaedalusStringFormatting.d
Created September 7, 2025 14:38
String formatting with %-expansion in Daedalus.
/*
* String formatting, given %s (string), %i (integer), and %f (float). The variable number of arguments are expected to
* be pushed on the stack. No error handling: If the number or order of arguments does not match, Gothic will crash.
*
* Example usage:
*
* MEM_PushStringParam("Mud");
* MEM_PushIntParam(24);
* castToIntf(1.2);
* out = STR_Format("Hello %s, give me %i ore! That is a %f % percent increase.");