Skip to content

Instantly share code, notes, and snippets.

First things first, obviously I work on SRE and EE. The thing that originally got me hyped about software was when I realized I could write tools that wrote more tools, or gave me leverage over the tasks at hand. I have net-negative interest in repetitive tasks and want to see us find ways to move faster with more confidence.

To me, classical specification-driven tools for parser or test or what have you generation are good examples of success in this field. You take a formal specification of some sort and begin to iterate on it and poke holes in it until you've arrived at something which produces the correct behavior. From a certain perspective, all of these tools are compilers. Sounds a lot like an LLM, but the basis in formal evaluation semantics brings confidence in the results of the tool. In theory at least, proof in software being what it is.

Current generation LLMs are best understood as a probabilistic recall database with lossy compression. An LLM is not a formal system, nor does it have any under

// A mostly complete implementation of the PromQL parse grammar
?start: expr+
// PromQL defines a bunch of suffix modifiers which we have to support
expr: simple_expr vector_range? vector_offset? vector_at?
?simple_expr: parenthetical | binary | invocation | vector_expr | literal
parenthetical: "(" expr ")"
#!/usr/bin/env python3
"""
Usage:
find src/app -name "*.scss" -exec ./scss-use-vars -I <your-theme.scss> {} \+
About:
This is a quick and dirty implementation of part of an SCSS decompiler.
It parses obvious color definitions, and replaces inline colors with definitions where possible.
diff --git a/libs/metadata/src/main/kotlin/io/elten/metadata/models/LogEntry.kt b/libs/metadata/src/main/kotlin/io/elten/metadata/models/LogEntry.kt
index b90704e78..b7fd96d64 100644
--- a/libs/metadata/src/main/kotlin/io/elten/metadata/models/LogEntry.kt
+++ b/libs/metadata/src/main/kotlin/io/elten/metadata/models/LogEntry.kt
@@ -1,5 +1,6 @@
package io.elten.metadata.models
+import io.elten.models.OrgEvent
import org.hibernate.annotations.Generated
import org.hibernate.annotations.GenerationTime
@arrdem
arrdem / clusterctrl.py
Created October 13, 2021 05:13
An approachable implementation of the ClusterCTRL/ClusterHAT i2c controller
"""An I2C driver for the ClusterCTRL/ClusterHAT device(s)."""
from enum import Enum
from itertools import chain, repeat
from time import sleep
from typing import Union
import smbus
---
openapi: 3.0.0
info:
title: A simple message queue over HTTP
tags:
- name: message
description: |
Operations pertaining to messages.
---
filters:
- name: Assigned, Reported, Commented and not resolved
jql: |
(assignee = currentUser() OR reporter = currentUser() OR comment ~ currentUser()) AND status != Resolved ORDER BY updated DESC
- name: My open issues
jql: |
assignee = currentUser() AND resolution = Unresolved order by updated DESC
@arrdem
arrdem / Nat.java
Created September 14, 2019 15:26
A thunk based implementation of natural numbers in Java
package me.arrdem.ox;
import io.lacuna.bifurcan.IList;
import io.lacuna.bifurcan.Lists;
import kotlin.jvm.functions.Function0;
import org.jetbrains.annotations.NotNull;
import java.math.BigInteger;
public final class Nat implements Comparable<Nat> {
#!/usr/bin/env python3
"""Evil monitoring.
Ping hosts, syslogging at INFO if they're up and happy, otherwise using Telnet scripting to force
reset them and syslogging at CRIT with what the uptime was prior to forced reboot.
Hosts are debounced, so that they have a chance to return before monitoring resumes.
No effort is made to detect network conditions or poweroffs.
#!/usr/bin/env -S pex proquint --
"""Compute random proquints as hostnames, throw 'em in zones."""
import sys
from random import randint
from proquint import uint2quint_str
# eight bits of provider addressing
ZONES = {"sfo2", "wbu1"}