Skip to content

Instantly share code, notes, and snippets.

View PatrickAuld's full-sized avatar

Patrick Auld PatrickAuld

View GitHub Profile
@PatrickAuld
PatrickAuld / gmailttl.gs
Last active February 23, 2022 00:11
Google Scripts helper to archive emails based on labels
/*
This allows archiving threads based on labels with TTLs.
Searches for all labels starting with ttl/. After the slash the label has the form {digit}(dwm).
The d|w|m unit is Days, Weeks, and Months.
If the latest message in a thread is older than the amount specified in the TTL, then it is archived.
*/
function myFunction() {
var labels = GmailApp.getUserLabels()
@PatrickAuld
PatrickAuld / gist:fae9487b5f6a0fed55a26522fa4d63e3
Last active October 26, 2017 17:35
Bazel build of envoy from envoy-filter-example w/ envoy submodule at tag v1.4.0
```
in envoy-filter-example/ on master
› bazel build //:envoy
<snip>
[ 71%] Building CXX object crypto/CMakeFiles/crypto_test.dir/bio/bio_test.cc.o
cd /private/var/tmp/_bazel_pauld/c2567331cc76560540bcdae4d8ac7636/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.build/boringssl/crypto && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DBORINGSSL_IMPLEMENTATION -I/private/var/tmp/_bazel_pauld/c2567331cc76560540bcdae4d8ac7636/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.build/boringssl/third_party/googletest/include -I/private/var/tmp/_bazel_pauld/c2567331cc76560540bcdae4d8ac7636/external/envoy_deps_cache_2c744dffd279d7e9e0910ce594eb4f4f/boringssl.dep.build/boringssl/crypto/../include -ggdb3 -fno-omit-frame-pointer -O2 -DNDEBUG -std=c++11 -Wall -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -ggdb -fvisibility=hidden -fno-common -Wnewline-eof -Wmissing-declarations -Wshadow -O2 -g -
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
kubernetes.io/cluster-service: "true"
spec:
@PatrickAuld
PatrickAuld / keybase.md
Created March 23, 2016 21:50
keybase.md

Keybase proof

I hereby claim:

  • I am PatrickAuld on github.
  • I am patrickauld (https://keybase.io/patrickauld) on keybase.
  • I have a public key whose fingerprint is 778F FE1B 64FA 53C5 0850 6527 ADEE 6EA1 CBA5 960D

To claim this, I am signing this object:

@PatrickAuld
PatrickAuld / toast.sh
Created March 7, 2016 22:45
Mac CLI notifier
#!/bin/bash
while getopts ":t:m:" opt; do
case $opt in
t) title="$OPTARG"
;;
m) message="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
;;
@PatrickAuld
PatrickAuld / .bash_rc
Last active February 26, 2016 17:55
Aliases a local docker-machine VM so that you don't have to update configs when the VM's IP changes.
# This gets the IP of a running Docker machine and sets it in /etc/hosts as 'localdocker'
setLocalDocker() {
docker-machine ip ${1-dev} | if xargs -I {} grep {} /etc/hosts > /dev/null; then true; else docker-machine ip ${1-dev} | xargs -I {} sudo sed -i "" -e "s/.*localdocker/{} localdocker/" /etc/hosts; fi;
}
#Cleanup utils
alias rmExitedContainers="docker ps -a | grep Exited | awk '{print \$1}' | xargs docker rm"
alias rmUnnamedContainers="docker images | grep '<none>' | awk '{print \$3}' | xargs docker rmi"
@PatrickAuld
PatrickAuld / .bash_rc
Created February 8, 2016 19:04
Multi-project Gradle Wrapper alias
findUp() {
x=`pwd`
while [ "$x" != "/" ]
do if [ -f $x/$1 ]
then
echo "$x/$1"
break
fi
x=`dirname "$x"`
done