Skip to content

Instantly share code, notes, and snippets.

View Sciencentistguy's full-sized avatar
🏳️‍🌈

Jamie Quigley Sciencentistguy

🏳️‍🌈
View GitHub Profile
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/na02pxyriabpnz65k88h7as8lm0hh7sa-go1.21.5.src.tar.gz
source root is go
setting SOURCE_DATE_EPOCH to timestamp 1701292906 of file go/test/zerosize.go
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
applying patch /nix/store/dnjqgkg38mq2w4p9kch75ijhgbcwk6wi-iana-etc-1.17.patch
patching file src/net/lookup_unix.go
Hunk #1 succeeded at 18 (offset -3 lines).
@Sciencentistguy
Sciencentistguy / day01.nix
Last active December 2, 2023 21:41
Advent of Code 2023 Day 01 in Nix
# nix eval -f day01.nix "part1"
# nix eval -f day01.nix "part2"
let
pkgs = import <nixpkgs> {};
in rec {
inherit (pkgs) lib;
# input :: string
input = builtins.readFile ~/.aoc/2023/day01.txt;

jamie's mini pseudo-release guide

  1. find the foreign-language release. if it does not exist, you should add that first
  2. source some reasonably-accepted / official english title translations / transliterations
  3. click "add a release" in the same release group as the original
  4. select "pseudo-release" in the "status" drop-down
  5. select the original in the "release duplicates" tab (this will fill in some stuff for you)
  6. set the titles and artist credits to the translated names (in the "artist" field, and the tracklist) (make sure you're still linking to the real artist, just with the transl{iter,}ated name)
  7. don't fill in any of the rest of the info (release date, country, label etc)
  8. submit (your edit note should probably say where you got the translations, or if you did them yourself say that)
@Sciencentistguy
Sciencentistguy / extract.sh
Last active December 9, 2022 22:42
A script to extract many kinds of archive
#!/usr/bin/env bash
# A script to extract many kinds of archive
# Code licence: MPL-2.0 (https://www.mozilla.org/en-US/MPL/2.0/)
if [ -f "$1" ]; then
case $1 in
*.tar*) tar xvf "$1" ;;
*.bz2) bunzip2 "$1" ;;
@Sciencentistguy
Sciencentistguy / search-edit.sh
Last active September 15, 2022 22:39
A script to interactively find a file, and open it in an editor
#!/usr/bin/env bash
# A script to interactively find a file, and open it in an editor
# Code licence: MPL-2.0 (https://www.mozilla.org/en-US/MPL/2.0/)
EDITOR="nvim"
filename=$(fzf)
@Sciencentistguy
Sciencentistguy / update-music-library.sh
Last active July 23, 2023 12:40
A script to sync my music library from my desktop PC to my server, using tailscale and rsync
#!/usr/bin/env bash
# A script to sync my music library from my server to my desktop PC, using tailscale and rsync.
# Code licence: MPL-2.0 (https://www.mozilla.org/en-US/MPL/2.0/)
SRC_HOSTNAME="atlas"
DEST_HOSTNAME="chronos"
SRC_LIBRARY_DIR="/storage-pool/media/Music/"
@Sciencentistguy
Sciencentistguy / listwhiches.py
Last active June 28, 2022 17:59
find nixpkgs packages to replace the contents of /usr/bin (or anywhere else)
import itertools
import os
import subprocess
import sys
def flatten(list_of_lists):
return list(itertools.chain.from_iterable(list_of_lists))
@Sciencentistguy
Sciencentistguy / exa-onedark.patch
Created February 3, 2022 01:18
Patches exa to use onedark.vim colours.
diff --git a/src/theme/default_theme.rs b/src/theme/default_theme.rs
index b4269b7..c60a720 100644
--- a/src/theme/default_theme.rs
+++ b/src/theme/default_theme.rs
@@ -12,32 +12,32 @@ impl UiStyles {
filekinds: FileKinds {
normal: Style::default(),
- directory: Blue.bold(),
- symlink: Cyan.normal(),
{ pkgs ? import <nixpkgs> { } }:
with pkgs; stdenv.mkDerivation {
pname = "savilerow";
version = "1.9.1";
src =
if stdenv.isDarwin
then
fetchTarball
{
@Sciencentistguy
Sciencentistguy / haskell-shell.nix
Created November 4, 2021 02:27
A "template" for shell.nix files for Haskell projects
let
# Pinned on <date> at <time> UTC, to <channel>
nixpkgs_url = "<nixpkgs commit url, see https://status.nixos.org/>";
# aliases in shellHooks don't work with zsh-nix-shell. See https://github.com/chisui/zsh-nix-shell/issues/6
zdotdir_url = "https://gist.githubusercontent.com/chisui/bba90fccc930f614743dc259fbadae6d/raw/4108222addc1d646c1b0a6d12130083e2219ad28/zdotdir.nix";
shell_hooks = ''
alias stack="stack --nix"
'';
in
{ pkgs ? import (fetchTarball nixpkgs_url) { }