Skip to content

Instantly share code, notes, and snippets.

View bossley9's full-sized avatar
🇹🇼

Sam Bossley bossley9

🇹🇼
View GitHub Profile
@jmatsushita
jmatsushita / README
Last active October 26, 2025 02:53
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
###
### [2023-06-19] UPDATE: Just tried to use my instructions again on a fresh install and it failed in a number of places.
###. Not sure if I'll update this gist (though I realise it seems to still have some traffic), but here's a list of
###. things to watch out for:
### - Check out the `nix-darwin` instructions, as they have changed.
### - There's a home manager gotcha https://github.com/nix-community/home-manager/issues/4026
###
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
@TkDodo
TkDodo / typed-react-query.tsx
Last active March 28, 2023 07:19
A factory function that creates a strictly typed version of useQuery and a strictly typed queryCache
type FunctionReturnsPromise<T> = (...args: Array<any>) => Promise<T>
type OfPromise<T> = T extends PromiseLike<infer R> ? R : T
export const createTypedQuery = <
QueryFn extends FunctionReturnsPromise<OfPromise<ReturnType<Schema[keyof Schema]>>>,
Schema extends Record<string, QueryFn>
>(
schema: Schema,
cacheConfig?: ConstructorParameters<typeof QueryCache>[0],
) => {
@heroheman
heroheman / ranger-cheatsheet.md
Last active October 25, 2025 04:55
Ranger Cheatsheet

Ranger Cheatsheet

General

Shortcut Description
ranger Start Ranger
Q Quit Ranger
R Reload current directory
? Ranger Manpages / Shortcuts
@HaleTom
HaleTom / print256colours.sh
Last active August 31, 2025 22:10
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256
@romainl
romainl / .ctags
Last active September 8, 2024 10:26
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss