Skip to content

Instantly share code, notes, and snippets.

View markus1189's full-sized avatar

Markus Hauck markus1189

  • Frankfurt am Main, Germany
View GitHub Profile
@markus1189
markus1189 / cataclysm-git-with-tilesets.nix
Created November 16, 2025 09:34
Cataclysm DDA Git with CDDA-Tilesets for NixOS
{ pkgs, lib ? pkgs.lib, ... }:
let
# Base Cataclysm DDA from git with specific version
cataclysm-dda-base = pkgs.cataclysm-dda-git.override {
version = "2025-11-16";
rev = "7a3e4046a6c80ade503b1443db9c8d58518d19e8";
sha256 = "sha256-0tvYuHODECN4zGD1vQys1+w7wbfr3eR2fuDdiunuTMI=";
};
@markus1189
markus1189 / MONGO_LOGS_GUIDE.md
Created October 25, 2025 08:11
MongoDB Log Message Analysis - Detailed guide for understanding MongoDB server logs

MongoDB Log Message Analysis Report

Overview

This report provides detailed analysis of MongoDB log messages to help developers understand logs retrieved from running MongoDB instances. Each entry includes the source code location, triggering conditions, logged attributes, and relevant context.


1. Slow query

Log ID: 51803

@markus1189
markus1189 / tracking-threadpool-implementation.md
Created October 9, 2025 05:35
Tracking Thread Pool Implementation for Spring Boot/Scala

Tracking Thread Pool Implementation

Context

This document describes the implementation of an isolated thread pool for HTTP tracking requests in a Spring Boot/Scala application. Tracking requests are non-critical, can take up to 30 seconds to timeout, and should not impact the main application's request handling.

Requirements

  • Volume: Up to 1000 tracking requests/second at peak
  • Timeout: 2 seconds for tracking requests (configured in RestClient)
@markus1189
markus1189 / context-length.sh
Created August 23, 2025 10:09
Calculate Claude Code context length from transcript JSONL using bash/jq
#\!/usr/bin/env nix
#\! nix shell nixpkgs#bash nixpkgs#jq nixpkgs#coreutils --command bash
set -euo pipefail
# Get context length from Claude Code transcript JSONL file
transcript_file="${1:-}"
if [[ -z "$transcript_file" || \! -f "$transcript_file" ]]; then
echo "Usage: $0 <transcript.jsonl>" >&2
exit 1
@markus1189
markus1189 / flake.nix
Last active June 19, 2025 07:39
Claude + Flake + Python Repo
{
description = "Claudex - A CLI proxy to run Claude API requests against OpenAI-compatible LLM providers";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
@markus1189
markus1189 / default.nix
Created May 31, 2024 08:52
Terminaltexteffects
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, pythonOlder
, poetry-core
}:
buildPythonPackage rec {
pname = "terminaltexteffects";
@markus1189
markus1189 / transaction.scala
Last active April 5, 2021 08:43
Using given for a function argument in Scala 3
// Example from https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html
import scala.collection.mutable.ListBuffer
import scala.util.chaining.*
class Transaction:
private val log = ListBuffer[String]()
private var aborted = false
private var committed = false
def println(s: String): Unit =
@markus1189
markus1189 / dungeondraft.nix
Created March 27, 2021 14:20
Nix buildFHSEnv for DungeonDraft
{ pkgs ? import <nixpkgs> { } }:
(pkgs.buildFHSUserEnv {
name = "DungeonDraftFhs";
targetPkgs = pkgs:
with pkgs; [
alsaLib
libglvnd
pulseaudioLight
] ++ (with xlibs; [
@markus1189
markus1189 / owm.nix
Created March 27, 2021 13:56
Nix buildFHSEnv expression for OtherWorldMapper (Demo)
{ pkgs ? import <nixpkgs> {}}:
(pkgs.buildFHSUserEnv {
name = "OtherWorldMapper-FHS";
targetPkgs = pkgs: with pkgs; [
gtk2-x11
xorg.libX11
expat
util-linux
pango
@markus1189
markus1189 / ZipArchiveStream.scala
Created July 3, 2019 08:10
Streaming creation of a zip archive with akka-streams
import java.io.ByteArrayOutputStream
import java.nio.charset.StandardCharsets
import java.nio.file.{Path, Paths}
import java.util.zip.{ZipEntry, ZipOutputStream}
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.{ActorMaterializer, IOResult}
import akka.stream.scaladsl.{FileIO, Flow, Keep, Source}
import akka.util.ByteString