Skip to content

Instantly share code, notes, and snippets.

View ariefrahmansyah's full-sized avatar
🇵🇸

Arief Rahmansyah ariefrahmansyah

🇵🇸
View GitHub Profile
@ariefrahmansyah
ariefrahmansyah / BatteryStatusNotification.scpt
Created March 29, 2022 02:31 — forked from brandon1024/BatteryStatusNotification.scpt
Battery Percentage Boundary Notification Background Script for macOS
repeat
set chargeState to do shell script "pmset -g batt | awk '{printf \"%s %s\\n\", $4,$5;exit}'"
set percentLeft to do shell script "pmset -g batt | egrep -ow '([0-9]{1,3})[%]' | egrep -ow '[0-9]{1,3}'"
considering numeric strings
if chargeState contains "Battery Power" and percentLeft ≤ 40 then
display notification "Time to plug me in :)" with title "Battery Charge Boundary"
else if chargeState contains "AC Power" and percentLeft ≥ 80 then
display notification "Time to unplug me :)" with title "Battery Charge Boundary"
end if
end considering
@ariefrahmansyah
ariefrahmansyah / protoc.go
Created March 22, 2020 22:50 — forked from mxk/protoc.go
TensorFlow Serving gRPC interface generator for Go
//+build ignore
// TensorFlow Serving gRPC interface generator.
//
// This script works around a bunch of issues (as of 2019-08-25) between Go's
// protobuf compiler plugin, Go modules, and definitions of TensorFlow and
// TensorFlow Serving proto files. It assumes that protoc and protoc-gen-go are
// on your PATH.
//
// git clone -b r1.15 https://github.com/tensorflow/tensorflow.git