Skip to content

Instantly share code, notes, and snippets.

View kylemcc's full-sized avatar

Kyle McCullough kylemcc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am kylemcc on github.
  • I am kylemcc (https://keybase.io/kylemcc) on keybase.
  • I have a public key whose fingerprint is 6743 6AFF 902F DA3D 9DC3 EA33 1C06 BAEB B810 0AF7

To claim this, I am signing this object:

@kylemcc
kylemcc / patch_socket.py
Last active December 23, 2015 20:38
Place in project/__init__.py to patch the socket class during test runs to notify when a test attempts to connect to an external service
import sys
class TestTriedToAccessNetwork(BaseException):
pass
if 'test' in sys.argv:
import socket
class PatchedSocket(socket.socket):
def __init__(self, *args, **kwargs):
@kylemcc
kylemcc / slowtest.py
Last active December 23, 2015 18:39 — forked from stantonk/slowtest.py
if 'test' in sys.argv:
import django.test
import time
class TimedTestCase(django.test.TestCase):
_TOO_LONG = 0.100
def run(self, *args, **kwargs):
_start = time.time()
super(TimedTestCase, self).run(*args, **kwargs)
@kylemcc
kylemcc / proxy.go
Created February 2, 2013 02:22
Basic Go TCP proxy...borrowed from someone...
package main
import (
"net"
"fmt"
"io"
"os"
"crypto/sha1"
"time"
)
@kylemcc
kylemcc / hack.sh
Last active January 27, 2016 11:59 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#