Skip to content

Instantly share code, notes, and snippets.

View pelson's full-sized avatar

Phil Elson pelson

View GitHub Profile
import requests
import zlib
import struct
import json
import html5lib
import re
import pprint
_gzip_header = b"\x1f\x8b\x08\x00\x00\x00\x00\x00\x02\xff"
@pelson
pelson / keybase.md
Created October 17, 2020 04:04
keybase.md

Keybase proof

I hereby claim:

  • I am pelson on github.
  • I am philelson (https://keybase.io/philelson) on keybase.
  • I have a public key ASC5YEUGODXl7DLY4FaYCBM0NGBZ82yPONB7e8QTLqNm1go

To claim this, I am signing this object:

@pelson
pelson / index.ipynb
Created July 3, 2020 12:41
Remap the colour of an image from JET to Viridis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / README.md
Last active February 4, 2020 09:43
Demonstration of pypi_simple and parsing wheel (PEP427) filenames

Demonstrates how to use pypi_simple to parse and manipulate PyPI wheel package metadata.

It takes quite some effort to figure out if a wheel is compatible with your system (platform_tag) and your Python version (python_tag), not to mention other features such as abi-tag, yanked status etc.. All in all, this points at a need for a high-level interface for package resolving with pip. (e.g. pip-tools, poetry, pip/wheel itself)

Stdout as of 2020-02-04:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): pypi.org:443
@pelson
pelson / index.ipynb
Created April 17, 2019 11:00
(old) Iris based interpolators, including spline and triangulation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / index.ipynb
Last active April 17, 2019 08:57
(old) Playing with Shapely and the 2012 Olympic torch track
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / index.ipynb
Created April 17, 2019 08:28
(old) Demo of automatic front and feature identification
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pelson
pelson / gfort.sh
Last active March 15, 2019 14:05
Demonstration of Intel Fortran compiler issue
gfortran -g main.f90 -fbacktrace -O0 && ./a.out
@pelson
pelson / .gitignore
Last active February 27, 2019 11:58
A quick proof-of-concept to wrap a C++ object in a Fortran 2003 object, and honouring the C++ object lifecycle
bin/
*.o
*.mod
.nfs*
@pelson
pelson / index.ipynb
Created January 20, 2019 14:23
CPython grammar and negative numbers - they only appear after an AST optimisation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.