Skip to content

Instantly share code, notes, and snippets.

Harry Percival hjwp

Block or report user

Report or block hjwp

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
hjwp /
Last active Feb 14, 2019
sqlalchemy mapping minimal example
'''stripped-down domain model, just order and warehouse'''
from __future__ import annotations
from dataclasses import dataclass
class Line:
sku: str
qty: int
View Dockerfile
FROM ubuntu
RUN apt-get update && apt-get install -y -q python3.7 python3.7-dev python3-pip git
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
RUN pip3 install pip pipenv
View index.html
<title>Hello, Greetings</title>
hjwp /
Created Jul 7, 2018
More Python and Django resources

Introductions to Python

In case some people don't get on well with the pluralsight course, there's a wealth of free Python resources out there. See the list on the /r/learnpython wiki:

I personally learned from "Dive into Python" which I recommend, it's nice and fast paced, aimed at people who already know programming in another language, and is linked there.


Keybase proof

I hereby claim:

  • I am hjwp on github.
  • I am hjwp ( on keybase.
  • I have a public key ASCDSKFHU12BdBf8anQUt_MjeXUbDrPT8W1GjWbhRpa-QQo

To claim this, I am signing this object:

hjwp /
Created Oct 13, 2017
a tiny thing
print('i am file 1')
hjwp / .gitignore
Last active Sep 16, 2017
selenium alert dismiss repro attempt
View .gitignore
hjwp /
Created Aug 9, 2017
a hideous hack to create a wagtail modeladmin view for a custom image class
from django.utils.translation import ugettext_lazy as _
from django.utils.safestring import mark_safe
from django.forms.utils import flatatt
from django.shortcuts import redirect
from wagtail.wagtailimages.views.images import edit as image_edit_view
from wagtail.contrib.modeladmin import views
View geckodriver.log
1489172367275 geckodriver INFO Listening on
1489172368371 mozprofile::profile INFO Using profile path /tmp/rust_mozprofile.umgbzIjSgMQF
1489172368371 geckodriver::marionette INFO Starting browser /usr/bin/firefox
1489172368373 geckodriver::marionette INFO Connecting to Marionette on localhost:36527
1489172369021 Marionette INFO Listening on port 36527
[Child 13641] WARNING: pipe error (3): Connection reset by peer: file /build/firefox-FILPL9/firefox-51.0.1+build2/ipc/chromium/src/chrome/common/, line 323
[Child 13641] ###!!! ABORT: Aborting on channel error.: file /build/firefox-FILPL9/firefox-51.0.1+build2/ipc/glue/MessageChannel.cpp, line 2056
[Child 13641] ###!!! ABORT: Aborting on channel error.: file /build/firefox-FILPL9/firefox-51.0.1+build2/ipc/glue/MessageChannel.cpp, line 2056
You can’t perform that action at this time.