Skip to content

Instantly share code, notes, and snippets.

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

Jacob Birkett spikespaz

🦀
Science is the scrutiny of magic.
View GitHub Profile
@spikespaz
spikespaz / NIX_CODESTYLE.md
Last active March 27, 2024 15:00
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:

class WebDriverThreadPoolExecutor(ThreadPoolExecutor):
def __init__(self, *args, driver_class, driver_options=None, logger=LOGGER_NAME, **kwargs):
self._logger = logging.getLogger(logger)
self._drivers = SimpleQueue()
for number in range(kwargs["max_workers"]):
self._logger.debug(
f"Spawning driver '{driver_class.__name__}' number {number}/{kwargs['max_workers']}")
self._drivers.put(driver_class(options=driver_options))
@spikespaz
spikespaz / vec_of_array.md
Created January 9, 2022 13:18 — forked from danielhenrymantilla/vec_of_array.md
Vec off arrays (or slices)

The most technically-correct answer to that question: make a Vec of references:

array.iter_mut().collect::<Vec<_>>();

no cloning involved, and you have a Vec.

In practice, however, it's gonna be lifetime-bound (Vec<&mut T> or Vec<&T> if using .iter()). Hence the following more useful answer, but it may involve cloning or other stuff:

@spikespaz
spikespaz / !PYTHON_SNIPPETS.md
Last active January 20, 2022 08:23
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.