This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Racket | |
(define-syntax (dbg! stx) | |
(syntax-case stx () | |
[(_ expr) | |
(with-syntax ([expr-str (format "~a" (syntax->datum #'expr))]) | |
#'(let ([result expr]) | |
(begin | |
(printf "~a = ~a\n" expr-str result) | |
result)))])) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S uv run --script | |
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "i3ipc", | |
# ] | |
# /// | |
# autoname-workspaces: adds icons to the workspace name for each open window. | |
# Refactored https://github.com/OctopusET/sway-contrib/blob/master/autoname-workspaces.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Triangle of Power operator in Scheme. | |
;; Tested in Racket, Guile, and Chicken; portable under R6RS+. | |
;; See https://mathcenter.oxford.emory.edu/site/math108/logs/ | |
;; and https://www.youtube.com/watch?v=sULa9Lc4pck | |
;; and https://math.stackexchange.com/questions/30046/alternative-notation-for-exponents-logs-and-roots/165225#165225 | |
;; to learn about "Triangle of Power" notation | |
;; Exponents Logs Radicals (triangle) operation | |
(define-syntax elr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set version_id (curl https://raw.githubusercontent.com/IntellectualSites/CurseForge-version-identifier/main/versions.json -s | jq '.[] | select(.name == "'$argv[2]'") | .id') | |
set mod_id (python3.12 -c 'import cloudscraper, sys; print(cloudscraper.create_scraper().get(f"https://legacy.curseforge.com/minecraft/mc-mods/{sys.argv[1]}").text)' $argv[1] | awk ' | |
/<span>Project ID<\/span>/ { | |
getline | |
gsub(/<[^>]*>/, "", $0) | |
print $0 | |
}' | string trim) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mv.ln --description 'Move a file/directory, create symlink in old location. Includes undo flag.' | |
argparse 'u/undo' -- $argv | |
or return | |
if [ (count $argv) -ne 2 ] | |
and [ not $_flag_undo ] | |
echo "Usage: mv.ln [-u|--undo] <source> <destination>" | |
return 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
set TIME (date +%H:%M) | |
set DATE (set LANG en_us_88591; date +"%b %d, %a") | |
set MEM_USE (free -t | awk 'FNR == 2 {printf("%.1f"), $3/$2*100}') | |
set CPU_USE (cat /proc/loadavg | awk '{ printf("%.2f"), $0;}') | |
set BATT (cat /sys/class/power_supply/battery/capacity) | |
set MISSED_CALLS (sqlite3 ~/.local/share/history-service/history.sqlite "SELECT COUNT(*) FROM 'voice_events' WHERE timestamp >= datetime('now','-1 hour') AND missed=1;") | |