Skip to content

Instantly share code, notes, and snippets.

@mgerhardy
mgerhardy / bbmodel.md
Created October 30, 2025 16:25
Blockbench model bbmodel format spec

Blockbench BBModel Format Specification

Overview

The BBModel (.bbmodel) format is a JSON-based 3D model format created by Blockbench. It supports hierarchical scene graphs, multiple element types (cubes, meshes), animations, textures, and various model formats (Java Block, Bedrock, Free).

Current Format Version: 5.0 (with backwards compatibility to 3.2+)


@mgerhardy
mgerhardy / git-cherry-pick-format
Last active September 3, 2025 11:51
This script cherry-picks a commit and applies clang-format to the changed files while preserving the original commit metadata.
#!/bin/bash
# git-cherry-pick-format - Git extension for cherry-picking and formatting commits
# Usage: git cherry-pick-format [--verbose] [--help] <commit-id>
#
# This script cherry-picks a commit and applies clang-format to the changed files
# while preserving the original commit metadata.
set -euo pipefail
IFS=$'\n\t'
@mgerhardy
mgerhardy / quake_comment_to_doxygen.py
Created September 3, 2025 08:01
convert quake style comments to doxygen style comments
#!/usr/bin/env python3
# Converts Quake-style comments to Doxygen-style comments in C/C++ source files for easier IDE integration
# Usage: python quake_comment_to_doxygen.py <file.c|file.h>
# Example: python quake_comment_to_doxygen.py mysource.c
import re
import os
import sys
def convert_comment_block(comment, func_name):
@mgerhardy
mgerhardy / fritz.py
Last active March 25, 2025 14:59
Fritz Box Dect Steckdose abfragen und in die Influx schieben
#!/usr/bin/env python3
# apt-get install python3-fritzconnection
import logging
import requests
from fritzconnection import FritzConnection
from fritzconnection.core.exceptions import FritzArrayIndexError
logger = logging.getLogger("metrics")
@mgerhardy
mgerhardy / gitlab-delete-old-pipelines.sh
Last active December 12, 2023 12:23
This script allows to delete old gitlab pipelines that still use disk space for the artifacts, build logs and so on
#!/bin/bash
#
# This script allows to delete old gitlab pipelines that still use disk space for the artifacts, build logs and so on.
# It will keep the last 100 pipelines. Make sure to modify your PRIVATE_TOKEN, your PROJECT_ID and your GITLAB_URL.
#
# If you want to run the script in dry mode - set _dryrun to 1 - it won't delete anything in that case, but just you the
# pipeline ids it would delete
#
# Used in combination with https://github.com/K-MailOrder/gitlab-migration to reduce the size of a gitlab instance
@mgerhardy
mgerhardy / gist:01b46f9485685b58050ee234bed31c0b
Created June 16, 2021 17:46
valgrind scummvm eventrecorder twine
==3124361== Invalid write of size 8
==3124361== at 0x483F7F3: memmove (vg_replace_strmem.c:1270)
==3124361== by 0x4DBF61: SurfaceSdlGraphicsManager::grabOverlay(void*, int) const (surfacesdl-graphics.cpp:1753)
==3124361== by 0x482051: ModularGraphicsBackend::grabOverlay(void*, int) (modular-backend.cpp:215)
==3124361== by 0x434EE1: GUI::ThemeEngine::clearAll() (ThemeEngine.cpp:376)
==3124361== by 0x40128E: GUI::EventRecorder::preDrawOverlayGui() (EventRecorder.cpp:558)
==3124361== by 0x481DB2: ModularGraphicsBackend::updateScreen() (modular-backend.cpp:173)
==3124361== by 0x559967: Graphics::Screen::updateScreen() (screen.cpp:62)
==3124361== by 0x55991C: Graphics::Screen::update() (screen.cpp:56)
==3124361== by 0x38AFC7: TwinE::TwineScreen::update() (twine.cpp:126)
@mgerhardy
mgerhardy / box2d.inl
Created March 21, 2021 12:43
box 2d world dump with revolute joint problem
b2Vec2 g(0, 9.81000042);
m_world->SetGravity(g);
b2Body** bodies = (b2Body**)b2Alloc(101 * sizeof(b2Body*));
b2Joint** joints = (b2Joint**)b2Alloc(1 * sizeof(b2Joint*));
{
b2BodyDef bd;
bd.type = b2BodyType(2);
bd.position.Set(6.46999979, 3.2349999);
bd.angle = 0;
bd.linearVelocity.Set(0, 0);
@mgerhardy
mgerhardy / achievements.h
Last active March 14, 2021 14:06
AGS: script to generate steam achievements
{
"adateinthepark",
Common::STEAM_ACHIEVEMENTS,
"468530",
{
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_0_PHOTO", "Eye of the Beholder", "Remnants of an enchanting evening..."),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_1_", "A Friend in Need", "Sometimes we all need some help."),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_2", "Explorer", "You know this place like the back of your hand!"),
ACHIEVEMENT_SIMPLE_ENTRY("NEW_ACHIEVEMENT_1_3", "An Old Head", "A strange discovery... A?"),
@mgerhardy
mgerhardy / agptek.sh
Created December 29, 2020 15:01
APGTEK mp3 player copy bash script - that handles the sorting of files properly (sort by name and by time)
#!/bin/bash
set -e
SOURCE_DIR=$1
TARGET_DIR=$2
DEBUG=${DBG:-0}
function info() {
echo -e "\e[92m$@\e[0m"
@mgerhardy
mgerhardy / nextcloud-deployment.yaml.j2
Last active August 26, 2020 19:45
nextcloud-deployment.yaml.j2
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: nextcloud-credentials
stringData:
NEXTCLOUD_ADMIN_USER: {{ nextcloud_admin_user }}
NEXTCLOUD_ADMIN_PASSWORD: {{ nextcloud_admin_password }}
---
apiVersion: apps/v1