I hereby claim:
- I am philpennock on github.
- I am philpennock (https://keybase.io/philpennock) on keybase.
- I have a public key whose fingerprint is C865 F6AF 2461 6A74 9836 576B 310D 6001 650E 06D3
To claim this, I am signing this object:
#!/bin/sh -u | |
CMD_NOT_FOUND=127 | |
PORT="${1:-8000}" | |
python3 -m http.server "$PORT" | |
ev=$? | |
[ $ev -ne $CMD_NOT_FOUND ] && exit $ev | |
python2 -m SimpleHTTPServer "$PORT" |
I hereby claim:
To claim this, I am signing this object:
origin_url=$(git config --local --get remote.origin.url) | |
case $origin_url in | |
github:*|git@github.*|*//github.*) | |
fetches="$(git config --local --get-all remote.origin.fetch)" | |
case $fetches in | |
*origin/pr/*) # no action | |
;; | |
*) | |
git config --local --add remote.origin.fetch '+refs/pull/*/head:refs/remotes/origin/pr/*' | |
;; |
def foo(a, b=None, cache={}): | |
if b is not None: | |
cache[a] = b | |
return b | |
if a in cache: | |
return cache[a] | |
raise KeyError('Bleh, no %s' % a) |
#!/usr/local/bin/python2.7 | |
from __future__ import print_function | |
import os | |
import threading | |
import time | |
startup_lock = threading.Lock() | |
COUNTER = None |
>>> def foo(alpha, *args, **kwargs): | |
... print 'Foo called, alpha = %s' % repr(alpha) | |
... for a in args: | |
... print 'Arg: {%s}' % repr(a) | |
... for k, v in kwargs.iteritems(): | |
... print 'Arg \"%s\" = \"%s\"' % (k, v) | |
... | |
>>> foo(234234, 'snert', 'wibble', 'bleurgh', fred=42, barney=-1) | |
Foo called, alpha = 234234 | |
Arg: {'snert'} |
#!/bin/bash -eu | |
progname="$(basename "$0")" | |
die() { printf >&2 "%s: %s\n" "$progname" "$*" ; exit 1; } | |
if [[ $# -gt 0 && "$1" == "cron" ]]; then | |
sleep $((10 + RANDOM % 40 )) | |
fi | |
dynhost=CENSORED |
#!/usr/bin/env python3.2 | |
""" | |
polygon: moo.com polygon puzzle solver | |
moo.com business cards might have a polygon puzzler on a promotional card in | |
the pack. This tool finds the words. | |
""" | |
__author__ = 'syscomet@gmail.com (Phil Pennock)' |
#!/bin/sh | |
groupname="${1:?Need a group to push to}" | |
branch="${2:-master}" | |
for r in $(git config "remotes.${groupname}"); do | |
echo >&2 "Pushing '${branch}' to '${r}'" | |
git push "$r" "$branch" | |
done |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"strconv" | |
"strings" |