Skip to content

Instantly share code, notes, and snippets.

View jdrzj's full-sized avatar
🐕

Jędrzej (NJ) Urbanski jdrzj

🐕
View GitHub Profile
@jdrzj
jdrzj / gist:76666ec6af01ae902802675246b5d1ca
Created May 21, 2024 14:40
Zsh Prompt with power source / battery level
function set_battery_envs() {
export POWER_SOURCE=$([[ $(pmset -g batt | grep -Eoi "(\w+) Power") == "Battery Power" ]] && echo "🔋" || echo "🔌")
export BATTERY_LEVEL=$(pmset -g batt | grep -Eoi '([0-9]{1,3}\%)' | grep -Eoi '[0-9]+')
PS1="(%h) %K{22}[${BATTERY_LEVEL}%%]%k ${POWER_SOURCE} %* %n:%~$ "
}
typeset -a precmd_functions
precmd_functions=(set_battery_envs)
setopt PROMPT_SUBST
@jdrzj
jdrzj / create_many_rows.sh
Last active December 9, 2018 13:01
Multiple rows into spreadsheet with Sheetsu
# Read more here: https://docs.sheetsu.com/?shell#create
curl "https://sheetsu.com/apis/v1.0/{your_api_id}" \
-X POST \
-H "Content-Type: application/json" \
-d '
{
"rows": [
{ "link": "https://google.com" },
{ "link": "https://www.apple.com/" },
{ "link": "https://sheetsu.com" },
@jdrzj
jdrzj / test.md
Created October 5, 2017 11:39
test.md

test