Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View SandroMachado's full-sized avatar

Sandro Machado SandroMachado

View GitHub Profile
[alias]
# branch (verbose)
br = branch -v
# commit
ci = commit --verbose
# amend your last commit
amend = commit --amend --verbose
@SandroMachado
SandroMachado / pi-reboot-on-network-failure
Created May 14, 2017 20:15
Script to reboot the raspberry pi if there is no network available
#!/bin/bash
while true
do
wget -q --tries=10 --timeout=20 --spider http://google.com
if [[ $? -eq 0 ]]; then
echo "Online"
else
echo "Offline"
echo raspberry | sudo -S sudo reboot
fi
@SandroMachado
SandroMachado / convert-to-webp.sh
Last active January 13, 2021 01:11
Script to convert all the `JPEG` images to the `WEBP` format in your Android project
#/bin/sh
# Inpiration: http://engineeringblog.yelp.com/2016/05/yelp-android-app-went-on-a-diet.html
# `-lossless` not used to give support for Android 4.0+
# Make sure cwebp is installed.
if ! type "cwebp" > /dev/null; then
echo "Please install cwebp to continue:"
echo "brew install webp"
exit 1
fi
### Keybase proof
I hereby claim:
* I am SandroMachado on github.
* I am sandromachado (https://keybase.io/sandromachado) on keybase.
* I have a public key whose fingerprint is 64A2 1ECB 97A1 604B D5B3 967E D630 EF06 008C 09AA
To claim this, I am signing this object: