Skip to content

Instantly share code, notes, and snippets.

View jojo2357's full-sized avatar
💭
working on everything all at once

jojo2357

💭
working on everything all at once
  • Earth, Republic of nunya
View GitHub Profile
@jojo2357
jojo2357 / kiwix-zimcomplete.sh
Created September 16, 2023 00:46
Kiwix-zim Bash Autocomplete
#!/usr/bin/bash
# this file is a part of kiwix-zim. See the License here: https://github.com/jojo2357/kiwix-zim/LICENSE
countryCodes() {
echo "AF"; echo "AL"; echo "DZ"; echo "AS"; echo "AD"; echo "AO"; echo "AI"; echo "AQ"; echo "AG"; echo "AR"; echo "AM"; echo "AW"; echo "AU"; echo "AT"; echo "AZ"; echo "BS"; echo "BH"; echo "BD"; echo "BB"; echo "BY"; echo "BE"; echo "BZ"; echo "BJ"; echo "BM"; echo "BT"; echo "BO"; echo "BO"; echo "BA"; echo "BW"; echo "BV"; echo "BR"; echo "IO"; echo "BN"; echo "BN"; echo "BG"; echo "BF"; echo "BI"; echo "KH"; echo "CM"; echo "CA"; echo "CV"; echo "KY"; echo "CF"; echo "TD"; echo "CL"; echo "CN"; echo "CX"; echo "CC"; echo "CO"; echo "KM"; echo "CG"; echo "CD"; echo "CK"; echo "CR"; echo "CI"; echo "CI"; echo "HR"; echo "CU"; echo "CY"; echo "CZ"; echo "DK"; echo "DJ"; echo "DM"; echo "DO"; echo "EC"; echo "EG"; echo "SV"; echo "GQ"; echo "ER"; echo "EE"; echo "ET"; echo "FK"; echo "FO"; echo "FJ"; echo "FI"; echo "FR"; echo "GF"; echo "PF"; echo "TF"; echo "GA"; echo
@jojo2357
jojo2357 / 99-monitor-connection.rules
Last active July 24, 2023 20:18
Linux align dock on seam
KERNEL=="card0", SUBSYSTEM=="drm", ENV{XAUTHORITY}="/path/to/xauthority", ENV{DISPLAY}=":display_number", RUN+="/bin/su ME -c /full/path/to/script"
@jojo2357
jojo2357 / raceist.js
Created October 4, 2022 00:19
Nodejs `+=` Race Condition
/*
* Using node v12.19.0 This demonstrates the potential dangers of sync/async.
* This likely will not print 20 ((0 + 1) + (1 + 1) ... + (4 + 1)) = 1 + 2 + 3 + 4 + 5 = 15
*/
/**
* @param arg {number}
* @return {Promise<number>} returns the arg provided after a timeout
*/
function sleep(arg) {