Skip to content

Instantly share code, notes, and snippets.

View 0atman's full-sized avatar
🦀
Oxidising

Tristram Oaten 0atman

🦀
Oxidising
View GitHub Profile
@0atman
0atman / dndbchar.nu
Last active September 20, 2026 10:36
Get a character quickref from the dndb api
#!/usr/bin/env nu
def main [id] {
curl -s $"https://character-service.dndbeyond.com/character/v5/character/($id)" | from json | get data
| select name classes stats race currencies inventory actions
| update classes {|r| $"($r | get race.baseRaceName) ($r | get classes | get 0 | get subclassDefinition.name) ($r | get classes | get 0 | get definition.name)"}
| update stats {|row| abilities ($row | get stats) }
| update inventory {|r| $r | get inventory | each {|r| $r | $r.definition.name} | str join ", "}
| update currencies {|r| $"($r | get currencies.gp)gp, ($r | get currencies.sp)sp, ($r | get currencies.cp)cp"}
| update actions {|r| $r | get actions | each {|r| $r | $r.class.name} | str join ", "}
@0atman
0atman / main.rs
Last active October 23, 2026 07:02
Working typestate pattern in rust
#!/usr/bin/env -S cargo +nightly -q -Zscript
---cargo
[package]
name = "typestate-pattern"
version = "0.1.0"
edition = "2024"
[lints.rust]
unsafe_code = "forbid"
@0atman
0atman / headings.css
Created May 12, 2026 13:34
Colored headings in obsidian
body {
--h1-color: var(--color-red);
--h2-color: var(--color-orange);
--h3-color: var(--color-yellow);
--h4-color: var(--color-green);
--h5-color: var(--color-blue);
--h6-color: var(--color-purple);
}
@0atman
0atman / fleeting.nu
Created September 16, 2025 06:19
My fleeting capture script, just makes a new file with the defined template
#!/usr/bin/env nu
print -n "Fleeting: "
let thought = (input)
let vault = "/home/oatman/Dropbox/Chamber/"
let template = $vault | path join "Resources/Meta/templates/Capture.md"
cd $vault
open $template | str replace -a "{{VALUE}}" $thought | save ($thought + ".md")

File Name

{{title|replace(',','_')|replace(':','_')|replace('/','_')|replace('\n','_')}}

Page Metadata

Make sure to change "Resources/Research/Readwise" to where Readwise stores your files!

-- @description Close gaps (remove space) between selected items
-- @author amagalma
-- @version 1.00
-- @donation https://www.paypal.me/amagalma
-- @about - Removes the space between consecutive items for all selected items. Works on a track by track basis.
local seth = 0.4
local jude = 0.6
local kate = 0.6
local nb = 0.2
@0atman
0atman / configuration.nix
Last active September 20, 2025 04:10
a reminder what a nixos nearly-out-of-the-box config looks like
{ config, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "laptop"; # Define your hostname.
networking.networkmanager.enable = true;
@0atman
0atman / siberspace.js
Created June 25, 2024 15:14
The source code to my track 'siberspace'
setcps(130/60/4)
samples('shabda/speech/fr-FR/f:Governments of the Industrial World')
samples('shabda/speech/fr-FR/f:you weary giants of flesh and steel')
samples('shabda/speech/fr-FR/f:aï come from saïberspace')
samples('shabda/speech/fr-FR/f:the new home of Maïnd.')
samples('shabda/speech/fr-FR/f:On behalf of the future')
samples('shabda/speech/fr-FR/f:aï ask you of the past')
samples('shabda/speech/fr-FR/f:to leave us alone')
@0atman
0atman / configuration.nix
Last active June 8, 2024 11:53
For people who just don't care about reproducibility, and just want a quiet life. Like me!
programs = {
steam.enable = true;
nix-ld = {
enable = true;
libraries = with pkgs; [
zlib
openssl
curl
# etc
];