C standard version detection
#ifndef __STDC_VERSION__
#error "C90"
#elif __STDC_VERSION__ == 202000L
#error "C23"
#elif __STDC_VERSION__ == 201710L
#!/usr/bin/env bash | |
set -euo pipefail | |
shopt -s failglob | |
# Bash snippets | |
# Change pwd to this script's dir | |
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | |
# CLI Options |
{ | |
inputs = { | |
flake-utils.url = "github:numtide/flake-utils"; | |
nix-github-actions = { | |
url = "github:nix-community/nix-github-actions"; | |
inputs.nixpkgs.follows = "nixpkgs"; | |
}; | |
}; |
clang-tools
must come before clang
# Show tree of nix dependencies
Random thoughts and opinions that I think might be good programming advice. Maybe. Grain of salt.
#!/usr/bin/env bash | |
# | |
# NixOS "Erase Your Darlings" ZFS install script based on: | |
# | |
# - Original install script by mx00s (https://gist.github.com/mx00s/ea2462a3fe6fdaa65692fe7ee824de3e) | |
# - Erase Your Darlings (https://grahamc.com/blog/erase-your-darlings) | |
# - ZFS Datasets for NixOS (https://grahamc.com/blog/nixos-on-zfs) | |
# - NixOS Manual (https://nixos.org/nixos/manual/) | |
# |
[alias] | |
lol = log --oneline --graph --decorate --date-order | |
lola = log --oneline --graph --decorate --date-order --all | |
s = status -s | |
ka = !gitk --all --date-order | |
k = !gitk --date-order | |
pull-sm = !git pull && git submodule update --recursive && git lfs fetch --all && git lfs pull | |
smu = !git submodule update --init --recursive && git lfs fetch --all && git lfs pull | |
smr = !git reset --hard --recurse-submodule && git submodule sync --recursive && git submodule update --init --force --recursive && git submodule foreach --recursive git clean -ffdx && git lfs fetch --all && git lfs pull |
# Disable "unknown" errors and missing type stubs... | |
# pyright: reportUnknownMemberType=false | |
# pyright: reportUnknownVariableType=false | |
# pyright: reportUnknownArgumentType=false | |
# pyright: reportMissingTypeStubs=false | |
# ...or, alternatively, only suppress individual objects (but disables intellisense) | |
from typing import Any |
from __future__ import annotations | |
from dataclasses import dataclass, asdict, is_dataclass | |
from typing import Any | |
from typing_extensions import dataclass_transform # pip install typing-extensions | |
import dacite # pip install dacite | |
import json | |
@dataclass_transform(kw_only_default=True) | |
class SerdeJson: | |
def __init_subclass__(cls): |