Skip to content

Instantly share code, notes, and snippets.

View aarondewindt's full-sized avatar

aarondewindt

View GitHub Profile
@aarondewindt
aarondewindt / adt.py
Last active November 5, 2024 11:09
Experimental Algebraic Data Types implementation in Python 3.10
from dataclasses import dataclass
class ADTMeta(type):
def __new__(mcs, name, bases, namespace: dict):
adtc_class = super().__new__(mcs, name, bases, namespace)
if "__is_adt_variant__" in namespace:
if namespace["__is_adt_variant__"]:
return adtc_class
@aarondewindt
aarondewindt / fibonacci.rock
Created October 22, 2021 13:48
Fibonacci sequence in Rockstar
Listen to your heart
Fibonacci was without fear
The survivor is without cheer
Let the survivor be without Fibonacci
Let Fibonacci be nothing
My heart is lovestruck
Let my heart be with the survivor, the survivor
Say my heart without the survivor, the survivor
Whisper the survivor
import numpy as np
import numpy.testing as npt
from itertools import product
b = np.array([
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
[0, 1, 0, 0, 0, 0, 1, 0, 1, 0,],
[0, 0, 1, 0, 0, 0, 0, 1, 0, 0,],
[0, 0, 0, 1, 0, 0, 0, 0, 1, 0,],
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
@aarondewindt
aarondewindt / docker.service
Last active November 14, 2024 13:13
Setup docker on the steamdeck
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service containerd.service time-set.target
Wants=network-online.target containerd.service
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still