Skip to content

Instantly share code, notes, and snippets.

View derekgottlieb's full-sized avatar

Derek Gottlieb derekgottlieb

View GitHub Profile
@derekgottlieb
derekgottlieb / openpgp.md
Created November 20, 2022 16:07
GPG Proof

openpgp4fpr:E6247FCC71C3687C00507423BDEB9D41AF5E86DF

@derekgottlieb
derekgottlieb / docker-compose.yml
Created May 13, 2020 15:05
pihole with cloudflare DNS over HTTPS
version: "3"
services:
pihole:
container_name: pihole
domainname: docker
hostname: pihole
image: pihole/pihole:beta-v5.0
dns:
- 127.0.0.1
- 1.1.1.1
#!/bin/bash
if [[ -z $1 ]]; then
echo "Usage: git nuketag tag"
exit 1
fi
tag="$1"
count=$(git tag | grep -c "$tag")
#!/bin/bash
git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}'
@derekgottlieb
derekgottlieb / git-prunelocal
Created April 3, 2017 13:29
git-prunelocal
#!/bin/bash
# Make sure our remote branch list is up to date
git remote update origin --prune
if [[ $# = 1 && $1 == '-n' ]]; then
git branch -vv | grep ' gone]'
else
git branch -vv | grep ' gone]' | egrep -v '^\*' | cut -f 3 -d ' ' | xargs git branch -D
fi
@derekgottlieb
derekgottlieb / linkdump.py
Last active August 31, 2016 02:28
iOS share to linkdump API
# coding: utf-8
import requests
import appex
import console
import dialogs
def main():
linkdump_url = 'http://linkdump.example.com'
if not appex.is_running_extension():
print('This script is intended to be run from the sharing extension.')
@derekgottlieb
derekgottlieb / i_o_s share u_r_l to apollo
Created June 5, 2016 12:36
iOS share URL to Apollo for Pythonista
# coding: utf-8
import requests
import appex
import console
group_one = "uuid-one"
group_two = "uuid-two"
group_three = "uuid-three"
def main():
describe 'object under test' do
describe 'method under test' do
it "should do the thing, but not wait so long" do
# Who doesn't like monkey patching to make tests go fast?
module Kernel
alias_method :old_sleep, :sleep
def sleep seconds
old_sleep 1
end
end
### Keybase proof
I hereby claim:
* I am derekgottlieb on github.
* I am derekgottlieb (https://keybase.io/derekgottlieb) on keybase.
* I have a public key whose fingerprint is E624 7FCC 71C3 687C 0050 7423 BDEB 9D41 AF5E 86DF
To claim this, I am signing this object: