Skip to content

Instantly share code, notes, and snippets.

View acid-bong's full-sized avatar

Acid Bong acid-bong

View GitHub Profile
@acid-bong
acid-bong / vcc.sh
Created August 9, 2022 08:07
VCC: edit the .c file (without the extension) and instantly recompile it and run. POSIX-compliant
#!/bin/sh
vcc () {
vim "${1}.c" &&
mkdir -p "$(dirname "${1}".c)"/bin &&
cc -Wall -Wextra -o "$(dirname "${1}".c)"/bin/"$(basename "$1")" "${1}".c &&
./"$(dirname "${1}".c)"/bin/"$(basename "$1")"
}
# Uncomment this if you intend to make it a script. Comment it/leave it commented if you source it in your .*shrc
#vcc "${1}"
@acid-bong
acid-bong / sl-wttr.sh
Created May 10, 2022 19:35
Custom weather (wttr.in) module for slstatus. The first script writes weather info into the temp file (hourly job for cron), the second one is ran by slstatus and reads the file (every 0.25s, cuz i like to update seconds in the status bar as well)
#!/bin/bash
printf "%s" "$(</tmp/wttr)"