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
@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.

@spikespaz
spikespaz / !EmbedJS.md
Last active February 18, 2022 02:35
JavaScript include that converts all anchor elements with the "--embed" class into highlighted code blocks (http://embed.spikespaz.com)

EmbedJS

This is a script to embed raw text into a page as highlighted code. It uses ajax requests to fetch the raw content from the URL inside of an anchor element, and then [highlight.js][0] to render the code.

The benefit of this over Github's gist embedding is that it can be used in a full page. If you want to mirror a Gist to [StackOverflow][1] for example, this script can be wrapped inside of a code snippet. Every time the gist that the code snippet points to is updated, the code rendered on StackOverflow will also update.