Skip to content

Instantly share code, notes, and snippets.

@maebert
maebert / instagram_unshred.py
Last active September 28, 2023 14:41
Instagram Engineering Challenge in 20 lines of code
# Problem to be solved:
# https://instagram-engineering.com/instagram-engineering-challenge-the-unshredder-7ef3f7323ab1
import PIL.Image, numpy, fractions
image = numpy.asarray(PIL.Image.open('TokyoPanoramaShredded.png').convert('L'))
diff = numpy.diff([numpy.mean(column) for column in image.transpose()])
threshold, width = 1, 0
def sequence(conn, start):
seq = [start]
@effigies
effigies / python_packaging_2019.md
Last active October 12, 2020 19:10
Contemporary Python Packaging - August 2019

Contemporary Python Packaging

This document lays out a set of Python packaging practices. I don't claim they are best practices, but they fit my needs, and might fit yours.

Validity

This document has been superseded as of July 2020.

This was written in July 2019. As of this writing Python 2.7 and Python 3.5 still have not