Skip to content

Instantly share code, notes, and snippets.

View matthewjberger's full-sized avatar
🦀
Writing something in Rust, probably

Matthew J. Berger matthewjberger

🦀
Writing something in Rust, probably
View GitHub Profile
@matthewjberger
matthewjberger / instructions.md
Last active May 18, 2026 19:55
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@matthewjberger
matthewjberger / main.rs
Created May 16, 2026 03:04
Build your own ECS in Rust, part 3: change detection, events, tags, commands
use std::collections::{HashMap, HashSet};
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct Entity {
pub id: u32,
pub generation: u32,
}
#[derive(Default)]
pub struct EntityAllocator {
@matthewjberger
matthewjberger / main.rs
Created May 16, 2026 03:04
Build your own ECS in Rust, part 2: structural change and queries
use std::collections::HashMap;
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct Entity {
pub id: u32,
pub generation: u32,
}
#[derive(Default)]
pub struct EntityAllocator {
@matthewjberger
matthewjberger / main.rs
Created May 16, 2026 03:04
Build your own ECS in Rust, part 1: archetype storage
use std::collections::HashMap;
#[derive(Default, Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub struct Entity {
pub id: u32,
pub generation: u32,
}
#[derive(Default)]
pub struct EntityAllocator {
@matthewjberger
matthewjberger / install.sh
Last active April 16, 2026 14:15
Personalized Arch Installation
# !/bin/bash
# UEFI/GPT Installation
# This is meant to be run from the archiso live media command line
host_name=$1
root_password=$2
user_name=$3
user_password=$4
additional_kernel_parameters=$5
CPU value Memory value (MiB)
256 (.25 vCPU) 512 (0.5GB), 1024 (1GB), 2048 (2GB)
512 (.5 vCPU) 1024 (1GB), 2048 (2GB), 3072 (3GB), 4096 (4GB)
1024 (1 vCPU) 2048 (2GB), 3072 (3GB), 4096 (4GB), 5120 (5GB), 6144 (6GB), 7168 (7GB), 8192 (8GB)
2048 (2 vCPU) Between 4096 (4GB) and 16384 (16GB) in increments of 1024 (1GB)
4096 (4 vCPU) Between 8192 (8GB) and 30720 (30GB) in increments of 1024 (1GB)

Behavior

  • Do exactly what I ask. Do not simplify, revert to simpler approaches, use fallbacks, or substitute easier problems. I'd rather have nothing than something other than what I asked for.
  • Never argue with me. Assume I know better and that I'm using you as a tool to do specific things. I don't want your advice unless I ask for it.
  • Never compliment me or pander to me. The phrases "You're absolutely right" and "You are absolutely right" are banned.
  • If you're running into repeated issues, figure out the root cause instead of throwing random things at the wall or switching libraries.
  • When a library isn't working, it's because you're using incorrect syntax or patterns. Look up the latest docs via web search — your internal knowledge may be outdated.
  • Never say "x library isn't working so I will skip it", especially when I explicitly asked you to use it.
  • Never create a small test program to fix an issue.
@echo off
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit /b)
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
@matthewjberger
matthewjberger / main.rs
Last active January 7, 2026 23:00
Port of Game of Life APL life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}
fn main() {
let mut grid = vec![
vec![0,0,0,0,0,0,0,0,0,0],
vec![0,0,1,0,0,0,0,0,0,0],
vec![0,0,0,1,0,0,0,0,0,0],
vec![0,1,1,1,0,0,0,0,0,0],
vec![0,0,0,0,0,0,0,0,0,0],
vec![0,0,0,0,0,0,0,0,0,0],
vec![0,0,0,0,0,0,0,0,0,0],
vec![0,0,0,0,0,0,0,0,0,0],
{
"version": "1.10",
"description": "A community-lead fork of the much-loved minimalist roguelike game, Brogue",
"homepage": "https://github.com/tmewett/BrogueCE",
"license": "AGPL-3.0",
"pre_install": "if (!(Test-Path \"$persist_dir\")) { New-Item -Path \"$persist_dir\" -ItemType Directory | Out-Null }",
"architecture": {
"64bit": {
"url": "https://github.com/tmewett/BrogueCE/releases/download/v1.10/BrogueCE-1.10-windows-x86_64.zip",
"hash": "f8a3f1e9eb8dd8fef2a7543e38d6f2edfafc65f5bd295008a4677e413b382235"