Skip to content

Instantly share code, notes, and snippets.

View michidk's full-sized avatar
🐳
🐳🐳

Michael Lohr michidk

🐳
🐳🐳
View GitHub Profile
@michidk
michidk / Cargo.toml
Last active October 10, 2026 13:22
Small Rust and Zig Hello World: 153-byte naked assembly on stable Rust and Zig, 157-byte Zig syscall wrappers; complete sources, Cargo config and verified builds
[package]
name = "tiny-hello"
version = "0.1.0"
edition = "2024"
[[bin]]
name = "hello-cargo"
path = "hello.rs"
[profile.release]
@michidk
michidk / renovate.json5
Last active October 10, 2026 16:39
The ultimate renovate config
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:best-practices",
":enableVulnerabilityAlerts",
"security:minimumReleaseAgeCrate"
],
"labels": [
@michidk
michidk / README.md
Last active August 9, 2026 08:38
Herdr plugin: launch OpenCode in newly added tabs while keeping pane splits as shells

OpenCode in New Herdr Tabs

A local Herdr plugin that launches opencode whenever a tab is added through the Herdr UI, keyboard shortcut, CLI, or socket API. A workspace's initial tab and pane splits continue to open the normal shell.

Requirements

  • Herdr 0.8.0 or newer
  • OpenCode available as opencode
@michidk
michidk / led_webserver.ino
Created October 5, 2025 12:27
ESP32 LED Webserver
#include <WiFi.h>
#include <WebServer.h>
#define LED_PIN 2 // Abhaenig vom Board
WebServer server(80);
const char* SSID = "WiFi Name";
const char* PASSWORD = "passwort123";
@michidk
michidk / main.zig
Last active April 21, 2025 16:29
Dynamic Zig Webserver
const std = @import("std");
const net = std.net;
const io = std.io;
const mem = std.mem;
const heap = std.heap;
const http = std.http;
const Response = struct {
status: []const u8,
headers: []const u8,
@michidk
michidk / main.zig
Last active April 21, 2025 16:29
Simple Zig Webserver
const std = @import("std");
const net = std.net;
const io = std.io;
const Response = struct {
status: []const u8,
headers: []const u8,
body: []const u8,
};
@michidk
michidk / gist:f4ab28e80450ef20ae9e404ea1a3b54c
Last active February 15, 2025 16:25
How to execute command on host Windows using devcontainers powered by WSL
We need some way to communicate.
-> Files. Dont even need a mount, since WSL/Windows has access to all files by default.
Windows filesystem notify events don't work in WSL filesystem mounted to windows.
-> Need to handle all logic in WSL
WSL can execute Windows .exe in Windows context.
Solution:
@michidk
michidk / 32bit.asm
Last active January 5, 2025 14:03
Hello World Optimized
BITS 32
org 0x08048000 ; Default base address for 32-bit executables
ehdr: ; Elf32_Ehdr
db 0x7F, "ELF" ; e_ident: ELF magic
db 1, 1, 1, 0 ; e_ident: 32 bit, little endian, version 1, target System V
db 0, 0, 0, 0, 0, 0, 0, 0 ; e_ident: padding
dw 2 ; e_type
dw 3 ; e_machine
@michidk
michidk / hello.asm
Last active January 5, 2025 14:03
Executable hello world
BITS 64
org 0x400000 ; Default base address for 64-bit executables
ehdr: ; Elf64_Ehdr
db 0x7F, "ELF" ; e_ident: ELF magic
db 2, 1, 1, 0 ; e_ident: 64 bit, little endian, version 1, target System V
db 0, 0, 0, 0, 0, 0, 0, 0 ; e_ident: padding
dw 2 ; e_type
dw 0x3E ; e_machine
@michidk
michidk / fuck.rust
Created May 10, 2024 19:29
Fix meh plz
use std::borrow::BorrowMut;
use std::collections::HashMap;
use std::hash::Hash;
use std::sync::Arc;
use async_trait::async_trait;
use log::debug;
use ratatui::backend::CrosstermBackend;
use ratatui::layout::Rect;