Skip to content

Instantly share code, notes, and snippets.

View samwise4's full-sized avatar

Sam Meier samwise4

  • SPIDA Software
  • Ohio, USA
View GitHub Profile
@samwise4
samwise4 / netwatch.sh
Last active October 10, 2023 01:23
Bash script to monitor internet outages
# return 1 if alive, 0 if dead
ping_success() {
! ping -c1 -W1 8.8.8.8 >/dev/null 2>&1
}
# Spinner taken from https://stackoverflow.com/a/12498395
spinnerindex=0
spinner='-\|/'
sleepy_spinner() {
for (( i=0; i<$(($1 * 2)); i++ ))
@samwise4
samwise4 / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console