Skip to content

Instantly share code, notes, and snippets.

View adamlazz's full-sized avatar

Adam Lazzarato adamlazz

View GitHub Profile

Keybase proof

I hereby claim:

  • I am adamlazz on github.
  • I am adamlazzarato (https://keybase.io/adamlazzarato) on keybase.
  • I have a public key ASAKmEUOD4qAjvRJgUzp9Lm92_RQdzXp_cchjp7R1C8AQQo

To claim this, I am signing this object:

@adamlazz
adamlazz / battery-pushover.sh
Created February 20, 2014 02:37
Send pushover notification when Mac battery gets low
#!/bin/bash
# Usage ./battery-pushover.sh <percent threshold>
batterypct() {
pct=`ioreg -n AppleSmartBattery | grep -i capacity | tr '\n' ' | ' | awk '{printf("%d", $10/$5 *100 )}'`
echo $pct
}
send() {
curl -s \
@adamlazz
adamlazz / tm-pushover.sh
Created January 24, 2014 21:19
Time Machine backup completion notifications using Pushover
#!/bin/sh
running(){
tmutil status | grep "Running" | awk '{print $3}' | cut -c 1
}
notify() {
DATE=`date`
curl -s \
-F "token=<use your own>" \
@adamlazz
adamlazz / gist:3813705
Last active October 11, 2015 05:57
Issuupress
//
// Adam Lazzarato
//
// Lists issuu uploads using the issue's thumbnails and titles
// To go in the loop body in issuupress.php
//
$output .= '<div style="float:left;"><a class="issuu-view" href="'.$doc_link.'" '.$link_target.'><center><img src="http://image.issuu.com/'.$dId.'/jpg/page_1_thumb_medium.jpg"><BR>'.$d->document->title.'</center></a></div>';