Skip to content

Instantly share code, notes, and snippets.

View chapmanjacobd's full-sized avatar
🥅
goal_net

Jacob Chapman chapmanjacobd

🥅
goal_net
View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active April 19, 2025 12:06
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯

Manually fixing bit flips in BTRFS

Somehow my BTRFS file system became corrupted by what appears to be a single bit flip in a metadata field. Rather than copying all the data and reformatting the file system, which would have required another disk at least as large as the original, I decided to try to fix this manually, which appears to have worked. I've documented the procedure I've used here, in case I need it again or someone else runs into a similar issue and finds it useful.

The first thing you should do is run btrfs check. For me this produced the following output:

Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p1
UUID: ec7afe1c-8478-450a-82fc-d17b32d8ca3d
@alexozwald
alexozwald / to-avif
Created November 27, 2023 11:48
to-avif ZSH conversion script using SVT-AV1 and ffmpeg
#!/usr/bin/env zsh
local img img_out img_short size_in_B size_out_B size_in size_out img_in_short img_out_short pct_diff
# Output coloring: Leep this compatability workaround or manually load the plugin using your plugin manager
[[ ! -e "/tmp/colors.plugin.zsh" ]] && curl -s "https://raw.githubusercontent.com/zpm-zsh/colors/master/colors.plugin.zsh" -o /tmp/colors.plugin.zsh
source /tmp/colors.plugin.zsh
# source ~/.zi/plugins/zpm-zsh---colors/colors.plugin/zsh
for IMG in ${argv[@]}; do
@kj800x
kj800x / Hacking the LG Monitor's EDID.md
Last active February 23, 2025 17:57
Hacking the LG Monitor's EDID

preface: Posting these online since it sounds like these notes are somewhat interesting based on a few folks I've shared with. These are semi-rough notes that I basically wrote for myself in case I ever needed to revisit this fix, so keep that in mind.

I recently bought an LG ULTRAGEAR monitor secondhand off of a coworker. I really love it and it's been great so far, but I ran into some minor issues with it in Linux. It works great on both Mac and Windows, but on Linux it displays just a black panel until I use the second monitor to go in and reduce the refresh rate down to 60 Hz.

This has worked decent so far but there's some issues:

  • It doesn't work while linux is booting up. The motherboards boot sequence is visible just fine, but as soon as control is handed over to Linux and I'd normally see a splash screen while I'm waiting for my login window, I see nothing.
  • It doesn't work on the login screen. This would be fine if login consistently worked on my second screen, but I need to manually switch
@veekaybee
veekaybee / normcore-llm.md
Last active May 12, 2025 06:56
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

#!/usr/bin/env python3
'''
Fetch and decode the links from a subreddit when they are encoded in base64 (until 3 pass)
Installation:
You need python 3.8 installed
Save the pastebin as a file i.e "redscrape.py" and open a terminal where the file is located
> python3 -m venv . # On Mac

Upgrade CentOS 7 to AlmaLinux 8

In 2020, Red Hat announced that CentOS 8 will no longer receive support after the end of 2021 and will be succeeded by CentOS Stream, see also our article 'What is CentOS Stream'. CentOS 7 will be supported longer until June 30, 2024.

You may want to upgrade to an alternative to CentOS before then, but reinstalling your VPS is not a desirable option. In this guide, we show you how to upgrade your VPS from CentOS 7 to AlmaLinux 8 (or OracleLinux or Rocky Linux).

The steps in this guide have been successfully tested on up-to-date installations of CentOS 7 and DirectAdmin 1.63.0 with CentOS 7.

Take a snapshot before you start the upgrade process so that you can fall back on it if you experience problems after upgrading to AlmaLinux.

@DavidBuchanan314
DavidBuchanan314 / NWSL.TXT
Last active September 11, 2024 04:48
I think this is functionally MIT-equivalent but I am not a lawyer!
NUCLEAR WASTE SOFTWARE LICENSE V1.0
Copyright <YEAR> <OWNER>
This software license is a message... and part of a system of messages...
pay attention to it! Writing this software and associated documentation
files (the "Software") was important to us. We considered ourselves to be a
powerful culture. This Software is not a place of honor... no highly
esteemed deed is commemorated here... nothing valued is here. What is here was
dangerous and repulsive to us. This message is a warning about danger. The
@hyperupcall
hyperupcall / settings.jsonc
Last active January 8, 2025 13:29
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
"""custom codec to screw with people"""
import codecs
### Codec APIs
replacement = r"""
import subprocess