Skip to content

Instantly share code, notes, and snippets.

View borestad's full-sized avatar

Johan Borestad borestad

View GitHub Profile
@borestad
borestad / unicode-arrows.txt
Created June 21, 2023 14:41
Arrows in Unicode
⟵ ⟶ ⟷ ← → ↓ ↑ ↕ ↔ ↖ ↘ ↗ ↙ ⇿ ⇽ ⇾ ⇄ ⇆ ⇈ ⇊ ⇉ ⇇ ⬱ ⇶ ⤡ ⤢ ↧ ↥ ↦ ↤ ↹ ⇐ ⇒ ⇔ ⇕ ⇑ ⇓ ⇗ ⇙ ⇖ ⇘ ⇦ ⇨ ⇧ ⇩ ⇳ ⇣ ⇡ ⇢ ⇠ ➙ ➝ ➞ ➘ ➚ ➛ ➡ ➟ ➠ ➜ ➥ ➦ ➢ ➣ ➤ ▶ ◀ ▼ ▲ ➲ ➧ ➽ ➾ ➪ ➩ ➱ ➯ ➴ ➶ ➷ ➹ ➳ ⬄ ⬀ ⬃ ⬁ ⬂ ⬇ ⬆ ⬍ ⬉ ⬊ ⬈ ⬋ ⤊ ⤋ ⟰ ⟱ ⇜ ⇝ ⬳ ⟿ ↜ ⬿ ↭ ⤳ ↝ ⤝ ⤞ ↚ ↛ ↞ ↠ ↟ ↡ ↢ ↣ ⤌ ⤍ ⬸ ⤑ ↼ ↽ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇋ ⇌ ⥪ ⥬ ⥫ ⥭ ⥍ ⥌ ⥊ ⥋ ⥎ ⥐ ⥏ ⥑ ⥒ ⥓ ⥔ ⥘ ⥖ ⥗ ↫ ↬ ↶ ↷ ↩ ↪ ⤶ ⤷ ⤴ ⤵ ⤣ ⤥ ⤤ ⤦ ⤾ ⤿ ⤸ ⤹ ⤺ ⤻ ↻ ↺ ⟳ ⟲ ⥁ ⥀ ↰ ↱ ↲ ↳ ⬐ ⬑ ⬎ ⬏ ⬲ ⟴ ⥺ ⭄ ⥂ ⥃ ⥆ ⥅ ⥻ ⥹ ⇱ ⇲ ↯
@borestad
borestad / bash argument parsing.md
Created September 20, 2023 08:32
This code snippet processes command line arguments and assigns values to variables based on the provided options. It supports options like -o (for output), -ttl (for time to live), and their corresponding long forms (--output, --ttl). It also handles

bash argument parsing

Preview:
URL=$1
shift 1

while [ "$#" -gt 0 ]; do
  case "$1" in
    -o) OUTPUT="$2"; shift 2;;
    -ttl) TTL="$2"; shift 2;;
@borestad
borestad / debuggerdemo.js
Last active October 11, 2023 17:17
Node Debugger demo
/*
Simple demo to show how the node inspector works
✨ 1: Run with:
node --inspect-brk debuggerdemo.js
By default, the debug process runs on "ws://127.0.0.1:9229", but you can change the port. See node --help for more info
--inspect[=[host:]port] activate inspector on host:port (default: 127.0.0.1:9229)
--inspect-brk[=[host:]port] activate inspector on host:port and break at start of user script
@borestad
borestad / debug.txt
Last active February 14, 2024 13:51
github-actions debug filesystem
$ cd /etc/apt/sources.list.d
$ cat microsoft-prod.list
deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/22.04/prod jammy main
$ cat ubuntu-toolchain-r-ubuntu-test-jammy.list
deb https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/ jammy main
# deb-src https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/ jammy main
@borestad
borestad / fix-arch-invalid-gpg-signature.sh
Created August 21, 2024 14:15
fix for "arch invalid or corrupted package (PGP signature)"
rm -r /etc/pacman.d/gnupg
pacman-key --init
pacman-key --refresh-keys
pacman-key --populate archlinux
pacman -Sy archlinux-keyring
pacman -Scc
pacman -Syyu