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
hjwp / domain_model.py
Last active Feb 14, 2019
sqlalchemy mapping minimal example
View domain_model.py
'''stripped-down domain model, just order and warehouse'''
from __future__ import annotations
from dataclasses import dataclass
@dataclass(unsafe_hash=True)
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
WORKDIR /tmp
View index.html
<htmL>
<head>
<title>Hello, Greetings</title>
</head>
</html>
@hjwp
hjwp / python_django_resources.md
Created Jul 7, 2018
More Python and Django resources
View python_django_resources.md

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.

View keybase.md

Keybase proof

I hereby claim:

  • I am hjwp on github.
  • I am hjwp (https://keybase.io/hjwp) on keybase.
  • I have a public key ASCDSKFHU12BdBf8anQUt_MjeXUbDrPT8W1GjWbhRpa-QQo

To claim this, I am signing this object:

@hjwp
hjwp / file1.py
Created Oct 13, 2017
a tiny thing
View file1.py
print('i am file 1')
@hjwp
hjwp / .gitignore
Last active Sep 16, 2017
selenium alert dismiss repro attempt
View .gitignore
geckodriver.log
@hjwp
hjwp / wagtail_hooks.py
Created Aug 9, 2017
a hideous hack to create a wagtail modeladmin view for a custom image class
View wagtail_hooks.py
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 127.0.0.1:60551
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/ipc_channel_posix.cc, 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.