Skip to content

Instantly share code, notes, and snippets.

Douglas Anderson hockeybuggy

Block or report user

Report or block hockeybuggy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hockeybuggy
hockeybuggy / keybase.md
Created Nov 14, 2016
An updated keybase file
View keybase.md

Keybase proof

I hereby claim:

  • I am hockeybuggy on github.
  • I am hockeybuggy (https://keybase.io/hockeybuggy) on keybase.
  • I have a public key whose fingerprint is 3B94 9D9D 977F ED50 6290 8E0A 9892 CB40 1284 3ABE

To claim this, I am signing this object:

View command-line-weather.sh
while (clear && curl wttr.in && sleep 300)do; done
@hockeybuggy
hockeybuggy / gitgc.txt
Created Sep 23, 2015
git gc is 'magic'
View gitgc.txt
➤ time git status
# On branch VA-3094-delete-facebook-app
nothing to commit (working directory clean)
git status 0.01s user 0.34s system 10% cpu 3.319 total
➤ git gc
Counting objects: 69991, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (22537/22537), done.
View keybase.md

Keybase proof

I hereby claim:

  • I am hockeybuggy on github.
  • I am hockeybuggy (https://keybase.io/hockeybuggy) on keybase.
  • I have a public key whose fingerprint is 2094 38E1 C441 3074 27F1 ACA4 D9B7 4215 C936 6F2A

To claim this, I am signing this object:

View trip-journal.md

Wind River 2015

A Yukon canoe odyssey with:

  • Douglas Anderson,
  • Leslie Hoyle
  • Cameron Elgie
  • Bill Elgie
View create_members.py
# Copy this into a python shell
from django.contrib.auth.models import User
from core.models import Member
from random import randint
from faker import Faker
faker = Faker()
for i in range(100):
u = User.objects.create_user(
@hockeybuggy
hockeybuggy / ipython_traceback.txt
Created Jul 17, 2015
Camelize problem in pyactive resource
View ipython_traceback.txt
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-40-94d5373ebb80> in <module>()
----> 1 p = sh_api.client.Order.find(status="any", limit=250, page=38)
/data/virtualenv/satellite/lib/python2.7/site-packages/pyactiveresource/activeresource.pyc in find(cls, id_, from_, **kwargs)
383 return cls._find_single(id_, **kwargs)
384
--> 385 return cls._find_every(from_=from_, **kwargs)
386
@hockeybuggy
hockeybuggy / test_status_codes.sh
Created May 20, 2015
Monitors status codes of two servers over time
View test_status_codes.sh
#!/bin/bash
while :
do
curl -s -o /dev/null -w "server 1: %{http_code}\n" -d "{'fake':'data'}" http://192.168.100.10:4000/bigcommerce/webhook/ \
&& curl -s -o /dev/null -w "server 2: %{http_code}\n" -d "{'fake':'data'}" http://192.168.100.10:4001/bigcommerce/webhook/
done
View call_prevention.py
class Test(object):
@property
def test1(self):
return potentially_expensive_call()
@property
def test2(self):
if not hasattr(self, "_test2"):
self._test2 = potentially_expensive_call()
return self._test2
@hockeybuggy
hockeybuggy / commit-msg
Last active Aug 29, 2015
Ensures that commit messages start with "VA-XXXX"
View commit-msg
#!/usr/bin/env python
# This commit-msg git hook takes a commit message as it first argument.
# It's purpose is to ensure that the message starts with "VA-XXXX"
import sys
import re
pattern = r"^[Vv][Aa]-\d+[\s\.]"
You can’t perform that action at this time.