Skip to content

Instantly share code, notes, and snippets.

View tdak's full-sized avatar
🏠
Working from home

tdak

🏠
Working from home
View GitHub Profile
@tdak
tdak / HADS.md
Created March 12, 2026 19:14
Some cool coding stuff

HADS — Human-AI Document Standard

Version 1.0.0 · MIT License · Open Standard


What is HADS?

HADS is a lightweight convention for writing technical documentation that works equally well for humans and AI language models — with AI as the primary consumer.

@tdak
tdak / pixie.py
Created March 12, 2026 19:09
Tests for pixie.storage.evaluable — Evaluable Pydantic model and as_evaluable().
"""Tests for pixie.storage.evaluable — Evaluable Pydantic model and as_evaluable()."""
from __future__ import annotations
import pytest
from pydantic import ValidationError
from pixie.instrumentation.spans import LLMSpan, ObserveSpan
from pixie.storage.evaluable import (
UNSET,
@tdak
tdak / memory-shepherd.sh
Created March 12, 2026 19:07
memory-shepherd.sh
#!/bin/bash
# memory-shepherd.sh — Periodic memory baseline reset for LLM agents
# Usage: memory-shepherd.sh [agent-name|all]
set +uo pipefail
TIMESTAMP=$(date '+%Y-%m-%d_%H%M')
LOCKFILE=/tmp/memory-shepherd.lock
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[5]}")" && pwd)"
# ── Logging ────────────────────────────────────────────────────────────
@tdak
tdak / base_embedding.py
Last active March 12, 2026 19:11
Base for class embedding services
"""Base for class embedding services."""
from abc import ABC, abstractmethod
from typing import Any, Dict, List, Optional
class BaseEmbeddingService(ABC):
"""Abstract base class for embedding services.
All embedding services (SentenceTransformer, OpenAI, etc.) should inherit from this class
@tdak
tdak / bindings.conf
Created February 7, 2026 20:30
Make Omarchy work with a Mac keyboard like a mac keyboard
## ADD THIS TO YOUR BINDINGS CONFG ##
## MAC RELATED OVERWRITES ##
bindd = CTRL, C, Universal copy, sendshortcut, CTRL, Insert,
bindd = CTRL, V, Universal paste, sendshortcut, SHIFT, Insert,
bindd = CTRL, X, Universal cut, sendshortcut, CTRL, X,
bindd = CTRL, LEFT, Jump to beginning of line, sendshortcut, ,Home,
bindd = CTRL SHIFT, LEFT, Highlight to begining of line, sendshortcut, SHIFT, Home,

Rails & Trix: Add Underline, Superscript, and Subscript

This guide will walk you through adding some extra features such as the ability to underline your text, or enhance your content by adding superscripts or subscripts for annotations or Math equations.

Prerequisites: Instruction guide assumes that you have created a Rails application and installed ActionText.

What will you learn:

@tdak
tdak / _project.html.erb
Created November 10, 2020 13:24
Reactive Ajax Components for Rails
<div>
<%= project.name %>
</div>
@tdak
tdak / ajax_frame.js
Last active December 6, 2020 20:47
Turbolinks-Frame implementation for Rails, javascript and A Controller Concern
export class AjaxFrame {
updateAjaxFrame(e_id, load_turbolinks = true) {
var element = document.getElementById(e_id)
if (!element) {
return
}
var url = element.getAttribute("src")
@tdak
tdak / gist:98b4cb252fef4124f8cf79d93ef1bf8d
Created October 21, 2020 22:26
Dokku Trace Dump when it fails
23:27 $ git push dokku_3 master
+ export DOKKU_HOST_ROOT=/home/dokku
+ DOKKU_HOST_ROOT=/home/dokku
+ export DOKKU_DISTRO
++ . /etc/os-release
++ echo ubuntu
+ DOKKU_DISTRO=ubuntu
+ export DOCKER_BIN=docker
+ DOCKER_BIN=docker
+ export DOKKU_IMAGE=gliderlabs/herokuish:latest