Skip to content

Instantly share code, notes, and snippets.

@gma
gma / board.css
Last active February 7, 2025 09:16
Kanban board CSS
body {
--primary-color: #222222;
--column-color: #eeeeee;
--task-color: #fefefe;
}
.board {
color: var(--primary-color);
}
@gma
gma / roller-bearings.md
Created February 2, 2025 15:00
Comments on Ploopy Adept bearings

Also in the UK, and have been doing a bit of reading up on this stuff. Definitely "not an expert" though!

I've discovered that this style of bearing can either come "open", "shielded" or "sealed". Open ones have the ball bearings exposed. Shielded have the bearings covered by a shield that's only attached to the outer bearing — these are ideal for applications where the inner ring rotates. If you were to spin the outer bearing at high speed, lubricant can escape, apparently. Sealed are supposed to be maintenance free, should keep hold of their lube, and seem to be what we want here.

I learned that on a supplier's product page for some MR63ZZ bearings made by a different manufacturer (MR63ZZ is a standardised design).

After a lot of searching, I noticed that the MR63ZZ models that are available to buy in the UK are either "open" or "shielded", rather than "sealed".

It turns out that there's also the MR63-2RS design, and they seem to have a rubber seal on each side. They're more expensive, but I think they'

@gma
gma / vscode-auto-format-astro-on-save.md
Last active April 26, 2022 11:08
Configuring VS Code to format Astro files with Prettier

Configuring VS Code to format Astro files with Prettier

There's an Astro extension for VS Code that provides syntax highlighting, completion and emmet support, but as of April 2022 it doesn't support auto-formatting.

There's a prettier plugin for Astro. We can install that and then configure VS Code to run Prettier when we save a file.

Installing prettier

Let's start by installing prettier and the Astro plugin into our project:

npm install -D prettier prettier-plugin-astro
@gma
gma / pacman.py
Created September 16, 2021 18:33
Python NW group coding session
# Pac-man orientation: v < > ∧
# . . .
# .V.
# . . .
grid = [
[1, 1, 1, 1, 1],
@gma
gma / tm.sh
Last active September 12, 2021 21:07
tm script for launching tmux via fzf
#!/bin/sh
TM_ROOT="${TM_ROOT:-$HOME/Projects}"
TM_DEPTH=${TM_DEPTH:-4}
TM_PROJECT_CONTAINS="${TM_PROJECT_CONTAINS:-.git}"
TM_CRITERIA="${TM_CRITERIA:--type d -name $TM_PROJECT_CONTAINS}"
TM_FILTER="${TM_FILTER:-cat}"
TM_EDITOR="${TM_EDITOR:-vi -c 'set number relativenumber'}"
## Functions
@gma
gma / cheat.sh
Created September 8, 2021 22:18
Script that hits cht.sh with query, results in a new tmux window
#!/bin/bash
## Functions
usage()
{
echo "Usage: $(basename $0) <arg> [args...]" 1>&2
exit 1
}
#!/bin/bash
GIGABYTES="${1:-1}"
ITERATIONS="${2:-1}"
MOUNT="/mnt/tank"
sshhh() {
grep -v "+0 records"
}
@gma
gma / build-kernel.sh
Created April 30, 2020 20:30
Work in progress to build patched Pop kernel
#!/bin/sh
set -e
apt-get source linux
pushd linux-*
# modify debian.master/changelog at this point
patch -p1 < <(curl URL of patch)
fakeroot debian/rules clean
fakeroot debian/rules binary-headers binary-generic binary-perarch skipmodule=true skipabi=true skipretpoline=true
popd
@gma
gma / x230-screen-and-aspm.patch
Last active January 18, 2025 02:31
Linux kernel patch for ThinkPad X230 with FHD (1080p) screen mod
diff -aur linux-5.13.0/drivers/acpi/pci_root.c linux-5.13.0-x230/drivers/acpi/pci_root.c
--- linux-5.13.0/drivers/acpi/pci_root.c 2021-09-14 20:19:11.000000000 +0100
+++ linux-5.13.0-x230/drivers/acpi/pci_root.c 2021-09-18 10:33:18.099360328 +0100
@@ -508,7 +508,6 @@
* flag here, to defer the action until after the ACPI
* root scan.
*/
- *no_aspm = 1;
}
}
@gma
gma / route.js
Created December 2, 2019 16:53
Stubbing XHR in Cypress
import axios from 'axios';
describe('Cypress', function() {
it('stubs a GET request', function() {
cy.server();
const endpoint = 'http://my-api-host/path';
cy.route('GET', endpoint, {
attr: [{ thing: 1234 }]