Skip to content

Instantly share code, notes, and snippets.

View rpkamp's full-sized avatar

Remon van de Kamp rpkamp

View GitHub Profile
@rpkamp
rpkamp / composer.json
Last active December 27, 2020 13:01
Google Cloud Platform pub/sub PHP example
{
"require": {
"google/cloud-pubsub": "^0.12.0"
}
}
@rpkamp
rpkamp / pre-commit.sh
Created January 8, 2018 09:02
Git pre-commit file to make sure ansible vaults are encypted
#!/bin/bash
for f in ansible/vars/*
do
LINE=$(head -n 1 $f)
if [ "$LINE" != "\$ANSIBLE_VAULT;1.1;AES256" ]; then
echo "File "$f" is not a valid ansible vault!"
exit 1
fi
done
@rpkamp
rpkamp / gist:7072408
Last active December 26, 2015 01:39
My Solution to a few of the #golang Tour exercises
///////
// Sqrt
func Sqrt(x float64) (z float64) {
z = 8.0
last, delta := z, 0.0000000000000005
for i := 0; i < 1000000000; i++ {
top := math.Pow(z, 2.0) - x
bottom := 2*z
z = z - top / bottom
if z < last * (1+delta) && z > last * (1-delta) {