Skip to content

Instantly share code, notes, and snippets.

View spikespaz's full-sized avatar
🦀
Science is merely the scrutiny of magic.

Jacob Birkett spikespaz

🦀
Science is merely the scrutiny of magic.
View GitHub Profile
My personal stance is that 1. all adjacent whitespace can be represented by a single token, 2. whitespace between expressions is significant, 3. whitespace adjacent to punctuation is parsed with the operator token, 4. no other whitespace is significant
# Overrides to keep packages building after Rust 1.80.0.
# There is a regression with type inference that primarily affects
# the `time` crate, so for packages that use it, go back one version.
# <https://github.com/NixOS/nixpkgs/issues/332957>
pkgs: pkgs0:
let
rustVersion = "1.79.0";
rustPlatform = pkgs.makeRustPlatform {
cargo = pkgs.rust-bin.stable.${rustVersion}.default;
rustc = pkgs.rust-bin.stable.${rustVersion}.default;
@spikespaz
spikespaz / eachNewer.nix
Last active April 5, 2025 19:09
Nix snippets not used
eachNewer = lib.filterAttrs (name: updatedPackage:
let
verNixpkgs = pkgs0.${name}.version;
verOverride = updatedPackage.version;
in if lib.versionOlder verNixpkgs verOverride then
true
else
lib.warn ''
package `${name}` has an overlay but the version in Nixpkgs is newer
(${verNixpkgs} >= ${verOverride})
@spikespaz
spikespaz / !GIT_SCRIPTS.md
Created August 29, 2024 06:29
Scripts for Git and friends

Git Scripts

Gist with files I have used for managing Git repositories

@spikespaz
spikespaz / vec_of_array.md
Created August 25, 2024 14:09 — forked from danielhenrymantilla/vec_of_array.md
Vec off arrays (or slices)

Question

how can I convert an array to a vec without cloning the values

Technically-correct answer

Make a Vec of references:

array.iter_mut().collect::<Vec<_>>();
@spikespaz
spikespaz / NIX_CODESTYLE.md
Last active April 1, 2024 08:11
Nix Pedantry (according to Jacob Birkett)
@spikespaz
spikespaz / MONITOR_ORDERING_ISSUE.md
Last active December 5, 2023 09:36
Monitor Connection Ordering Issue Recount

Summary

I have multiple monitors connected to a Thunderbolt 4 hub, and the monitors must be connected in a specific order to ensure that their respective profiles (position, refresh rate, resolution) are applied.

Setup

DEVICE NAME Description
HOST ThinkPad P14s Gen 4 (AMD).
MASTER_HUB Anker PowerExpand 5-in-1. Has one THUNDERBOLT4_HOST and 10gb/s USB-A on the front, and 3x Thunderbolt 4 (USB-C) split passthru and a DC power jack on the back.
@spikespaz
spikespaz / bg3_curated_mods.md
Last active September 1, 2023 10:37
Jacob's Mod List for Baldur's Gate 3 Full Release

Jacob's Mod List for Baldur's Gate 3 Full Release

For the sake of brevity, I will refer to the path D:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3 as GAMEDIR. This path will be different for your computer.

Mod Manager (for Divinity Engine, not native mods)

I do not recommend NexusMods' Vortex. It just doesn't work, and UI is confusing.

Keybase proof

I hereby claim:

  • I am spikespaz on github.
  • I am spikespaz (https://keybase.io/spikespaz) on keybase.
  • I have a public key ASAzP28yonIhOdu2z7XlFOEoqCBqJeyyJ7dNlnbzrTlanAo

To claim this, I am signing this object:

@spikespaz
spikespaz / !PYTHON_SNIPPETS.md
Last active August 25, 2024 14:28
Python Snippets

Python Snippets

A collection of useful code snippets that I have collected over time. They are mostly all written by me.