Skip to content

Instantly share code, notes, and snippets.

View morty's full-sized avatar

Tom Mortimer-Jones morty

View GitHub Profile
@morty
morty / run_at_time.py
Created November 17, 2016 10:59
Simple Django management command to run the application at a given timestamp
from django.core.management.base import BaseCommand
from django.core.management import call_command
from freezegun import freeze_time
class Command(BaseCommand):
help = 'Run application at given time'
def add_arguments(self, parser):
parser.add_argument('timestamp', nargs='?',
Traceback (most recent call last):
File "/home/tom/docker/datacats/venv/local/lib/python2.7/site-packages/datacats/cli/main.py", line 93, in main
return command_fn(opts)
File "/home/tom/docker/datacats/venv/local/lib/python2.7/site-packages/datacats/cli/pull.py", line 46, in pull
retrying_pull_image(i)
File "/home/tom/docker/datacats/venv/local/lib/python2.7/site-packages/datacats/cli/pull.py", line 52, in retrying_pull_image
"Failed to pull image {}.".format(image_name))
File "/home/tom/docker/datacats/venv/local/lib/python2.7/site-packages/datacats/cli/pull.py", line 72, in _retry_func
func(param)
File "/home/tom/docker/datacats/venv/local/lib/python2.7/site-packages/datacats/cli/pull.py", line 83, in pull_image
@morty
morty / keybase.md
Created February 26, 2015 13:43
keybase.md

Keybase proof

I hereby claim:

  • I am morty on github.
  • I am morty (https://keybase.io/morty) on keybase.
  • I have a public key whose fingerprint is 2D8C AF23 A509 5D10 E197 7D62 CDAC C03C FBB6 0B57

To claim this, I am signing this object:

@morty
morty / gist:993ccf0e2dba2624f4dd
Created September 11, 2014 12:07
Basic Mollom spam classification with Python
import requests
from requests_oauthlib import OAuth1
mollom_content_url = 'http://rest.mollom.com/v1/content'
publicKey = "XXX"
privateKey = "YYY"
auth = OAuth1(publicKey, privateKey)