Skip to content

Instantly share code, notes, and snippets.

View MikeTeddyOmondi's full-sized avatar
🎯
Focusing

Mike Teddy Omondi MikeTeddyOmondi

🎯
Focusing
View GitHub Profile
@MikeTeddyOmondi
MikeTeddyOmondi / arena.h
Last active March 20, 2026 14:23
Tinker with Arena Allocations
/*
* arena.hSingle-header arena allocator (STB-style)
*
* USAGE
* -----
* In exactly ONE .c file, before including this header:
*
* #define ARENA_IMPLEMENTATION
* #include "arena.h"
*
@RichardBray
RichardBray / acl.hujson
Created February 10, 2026 16:47
Access control policy example file for Headscale
{
"acls": [
{"action": "accept", "src": ["*"], "dst": ["*:*"]}
],
"ssh": [
{"action": "accept", "src": ["autogroup:member"], "dst": ["autogroup:member"], "users": ["root"]}
]
}
@RichardBray
RichardBray / docker-compose.yml
Last active March 12, 2026 10:39
Docker file for headscale, headscale-ui and caddy
services:
headscale:
image: docker.io/headscale/headscale:stable
restart: unless-stopped
container_name: headscale
read_only: true
tmpfs:
- /var/run/headscale
ports:
- "27896:8080"
# ===========================================
# ZSH Hacks - Dreams of Code
# ===========================================
# Add these to your .zshrc file
# ===========================================
# -------------------------------------------
# 1. Edit Command Buffer
# -------------------------------------------
# Open the current command in your $EDITOR (e.g., neovim)
import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
@morrismusumi
morrismusumi / external_ceph_cluster_for_kubernetes.md
Last active February 6, 2026 23:56
External Ceph Cluster for Kubernetes

External Ceph Cluster for Kubernetes

Create an external Ceph Cluster for all your Kubernetes clusters.

INSTALL CEPHADM

  • Prerequisites:
    • 3 VMs, with unused disks
  • Python 3, Cephadm is a Python-based utility
@t3dotgg
t3dotgg / try-catch.ts
Last active March 10, 2026 03:34
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};

Next.js Starters

A list of CLI generators, starter kits / boilerplates and toolkits to kick start your Next.js apps.

  • What is included in this list:
    • Has ~1K+ Github stars
    • Actively maintained / up to date
    • Includes a style / css solution or UI Framework
    • Includes a database
  • Includes authentication / authorization
import { Client } from "@upstash/qstash"
import { NextRequest } from "next/server"
const baseUrl = process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL}`
: "http://localhost:3000"
interface Step<I> {
create: <O>(action: (prevResult: Awaited<I>) => O) => Step<O>
finally: (action: (prevResult: Awaited<I>) => any) => any
@mattdy
mattdy / .traefik-cloudflare-tunnel
Last active November 15, 2025 20:12
Traefik on Docker Swarm accessed via Cloudflare Tunnel
Please see https://mattdyson.org/blog/2024/02/using-traefik-with-cloudflare-tunnels for a detailed write-up of this configuration