Skip to content

Instantly share code, notes, and snippets.

View nloadholtes's full-sized avatar
👍
here

Nick Loadholtes nloadholtes

👍
here
View GitHub Profile
@nloadholtes
nloadholtes / gist:2280118
Created April 2, 2012 02:29
git alias for local (project) overrides
# This will create a local (project specific) alias
# to see what changes are outgoing from your repo/branch
# (like what 'hg out' supplies, but specific to the
# specified branch
git config --local "alias.out log origin/<branch_name>..HEAD"
@nloadholtes
nloadholtes / worker.py
Created April 5, 2012 14:41
Gearman 2.x worker example
#
# worker.py
#
# Based on code from http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps/
#
import time
from gearman import GearmanWorker
def speakTask(gearman_worker, job):
@nloadholtes
nloadholtes / client.py
Created April 5, 2012 14:42
Gearman 2.x client example
#
# client.py
#
# Based on code from http://www.darkcoding.net/software/choosing-a-message-queue-for-python-on-ubuntu-on-a-vps/
#
import sys
import time
from gearman import GearmanClient
@nloadholtes
nloadholtes / job_keywords.txt
Created April 11, 2012 02:43
A quick-and-dirty word frequency counter
217 python
113 web
77 django
55 linux
55 javascript
54 programming
50 design
47 mysql
47 data
44 computer
@nloadholtes
nloadholtes / pic2shop_grabber.py
Created November 26, 2012 19:43
Playing around to figure out an API
#
# script for getting data from pic2shop.com
# Nick Loadholtes <nick@ironboundsoftware.com>
#
# Nov 26, 2012
#
import csv
import sys
import random
import time
@nloadholtes
nloadholtes / scramble.py
Created May 16, 2013 19:40
Scramble text into oblivion
import random
import string
CHARS = string.letters + " " + string.digits
def scramble(input, keep_length=True):
output = []
for x in input:
output.append(random.choice(CHARS))
@nloadholtes
nloadholtes / testing_with_main.py
Last active December 18, 2015 14:39
nose main call
# For unittest based tests, this works:
if __name__ == '__main__':
unittest.main()
# And the equivilent in nose is this:
if __name__ == '__main__':
import nose
nose.run(defaultTest=__name__)
@nloadholtes
nloadholtes / gist:5802352
Created June 18, 2013 02:53
plugin debugging
nosetests -vvvvv --pdb -s

Keybase proof

I hereby claim:

  • I am nloadholtes on github.
  • I am nloadholtes (https://keybase.io/nloadholtes) on keybase.
  • I have a public key whose fingerprint is C29F 1D65 3ED3 8281 A781 2EA2 F4B8 AD62 6976 378E

To claim this, I am signing this object:

@nloadholtes
nloadholtes / docker_gui_apps_linux_mint
Created May 24, 2015 04:02
Getting ubuntu 14/Linux Mint 17 to show GUI apps from Docker
Newer version of Ubuntu (and Linux mint) have .Xauthority and that will interfere with your ability to run X11 apps from a docker container. Here's how you get around that:
docker run -ti -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY --net=host -v $HOME/.Xauthority:/root/.Xauthority <and the rest of your docker string...>