This file contains 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
#!/bin/bash | |
# battery monitor systemd suspend/resume hook | |
LOGFILE=/var/log/battery.csv | |
KERNEL=$(uname -r) | |
BIOS=$(dmidecode -s bios-version) | |
log() { | |
cd /sys/class/power_supply |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#!/bin/bash | |
# brew install xbar jq | |
# pip install astro-cli | |
PATH=$PATH:/usr/local/bin | |
ASTRO=$(pyenv which astro) | |
$ASTRO --date "a week ago" -f json moon phases | jq -r "first | .emoji" | |
echo "---" | |
echo "phases | size=10" |
This file contains 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
let more = true | |
let data = [] | |
let offset = 0 | |
while (more) { | |
console.log(`Fetch offset: ${offset}`) | |
var req = new XMLHttpRequest(); | |
req.open("GET", `https://www.pedidosya.com.ar/mobile/v2/users/myOrders?state=CONFIRMED&max=10&offset=${offset}&countryId=3`, false); | |
req.send(null) | |
let response = JSON.parse(req.responseText) |
This file contains 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
curl -sL whatthecommit.com | htmlq "#content p:first-child" -tw | sed '/^$/d' |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
#!/bin/bash | |
# clone repo | |
git clone --bare git@github.com:redraw/dotfiles.git $HOME/.dotfiles | |
dotfiles () { git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME "$@"; } | |
# backup | |
for file in $(dotfiles ls-tree --name-only HEAD); do | |
mv -vf $file $file.bak 2>/dev/null | |
done |
This file contains 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
inotify(watch/wait) -- inotify tools to monitor file changes | |
wrk -- stress http server test | |
sendmidi/receivemidi -- midi tools | |
ipcalc -- calculate network hosts ranges | |
pup -- parse DOM | |
pyp -- pipe to python | |
qrcp -- transfer files scanning qr | |
gotty -- share tty | |
zerotier -- free tunnel / private LAN mesh network | |
castnow -- cast media to chromecast |
This file contains 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
>>> class A(): | |
...: def uno(self): | |
...: print("A uno") | |
>>> class B(): | |
...: def uno(self): | |
...: print("B uno") | |
...: def dos(self): | |
...: print("B dos") | |
...: |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.