Skip to content

Instantly share code, notes, and snippets.

View MatrixManAtYrService's full-sized avatar

Matt Rixman MatrixManAtYrService

View GitHub Profile
@MatrixManAtYrService
MatrixManAtYrService / claude.nix
Created March 16, 2025 04:54
claude code in a nix devshell
{ pkgs, claude-code-tarball, claude-code-version }:
pkgs.stdenv.mkDerivation {
name = "claude-code";
version = claude-code-version;
src = claude-code-tarball;
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/lib/node_modules/@anthropic-ai/claude-code

This gist contains notes that I took while installing NixOS onto a nanopi r5s. Many thanks to the kind folks in this issue who helped me along the way.

@MatrixManAtYrService
MatrixManAtYrService / deployment2csv.py
Last active December 26, 2024 20:03
Dumping Dag Runs from Astronomer to CSV
import airflow_client
from airflow_client.client.api import dag_api, dag_run_api
from datetime import datetime
import csv
import sys
from time import sleep
# you will need a different token than this one, see Workspace Settings -> Access Management to create one
token = "eyJhbGcREDACTED-Jjw6GJAp5A"
@MatrixManAtYrService
MatrixManAtYrService / fancydict.py
Last active June 5, 2024 22:14
Using generics and abstract base classes to create something like a dict which maps between two custom types
from abc import ABC, abstractmethod
from collections.abc import Iterator, MutableMapping
from pathlib import Path
from typing import Generic, TypeVar, cast, Type, Dict
from pydantic import BaseModel, Field
K = TypeVar('K', bound='Key')
V = TypeVar('V', bound='Value')

Some more of the standard library

You already know something about sys and pathlib. Now it's time to learn about venv.

venv creates virtual environments (which are a more lightweight than a virtual machine, but they're similar in how they isolate their contents from the rest of your system. This lets us install third-party libraries in a sane way. If you don't use them, things get cluttered quickly.

Please read/watch the following:

@MatrixManAtYrService
MatrixManAtYrService / flake.nix
Last active March 5, 2024 21:59
radicle in a nix devshell
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs?ref=23.11";
radicle.url = "git+https://seed.radicle.xyz/z3gqcJUoA1n9HaHKufZs5FCSGazv5?ref=master";
};
outputs = { self, nixpkgs, flake-utils, radicle }:
flake-utils.lib.eachDefaultSystem (system:
let
@MatrixManAtYrService
MatrixManAtYrService / 1_intro.md
Last active March 1, 2024 20:44
libcst vs refactor, an unfair trial

This analysis of libcst vs refactor is incomplete. I probably won't come back and complete it (maybe your case warrants more analysis than my case did).

I had a difficult time with refactor a while back, so I recently tried libcst. I couldn't remember exactly why I had a difficult time, maybe I just didn't sleep well the night before or some kind of non-reason like that. Rather than justify this to myself, I just went with libcst.

I ended up with this:

from time import sleep
def main() -> None:
foo(
json={"code": 200, "response": data.dict(), # <-- missing '}'
headers={"Content-Type": "application/json"}
)
sleep(1) #<-- green
sleep(1)
sleep(1) #<-- white
@MatrixManAtYrService
MatrixManAtYrService / git.nix
Created February 6, 2024 03:54
home manager git config to use ssh instead of http for github
git = {
enable = true;
extraConfig = {
"url \"[email protected]:\"".insteadOf = "https://github.com/";
};
};
@MatrixManAtYrService
MatrixManAtYrService / resume.json
Last active September 30, 2023 01:16
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Matt Rixman",
"label": "Bits, Bytes, and Theorems",
"image": "https://avatars.githubusercontent.com/u/5834582?s=96&v=4",
"email": "[email protected]",
"summary": "I am in search of interesting problems that can be solved with code. Bonus points if they're socially impactful, open source, or peer-to-peer.",
"profiles": [
{