Skip to content

Instantly share code, notes, and snippets.

View prschmid's full-sized avatar

Patrick Schmid prschmid

  • Sharpen
View GitHub Profile
@prschmid
prschmid / idsentence.py
Last active January 17, 2023 00:02
Implement a memorable ID string. The original idea for this comes from Asana where it is documented on their blog: http://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/
"""Implement a memorable ID string.
The original idea for this comes from Asana where it is documented on their
blog:
http://blog.asana.com/2011/09/6-sad-squid-snuggle-softly/
There are other partial implementations of this and can be found here:
Node.js: https://github.com/linus/greg
Java: https://github.com/PerWiklander/IdentifierSentence
@prschmid
prschmid / bytes_to_bitstring.py
Created January 3, 2013 05:51
A simple helper function that takes some input data (bytes) and converts it to a string of "bits" for debugging purposes.
def bytes_to_bitstring(bytes, size=32):
"""A simple helper function that takes some input data (bytes) and converts
it to a string of "bits" for debugging purposes.
Args:
bytes: The data to convert to a string of bits
size: The size (in bits) of the input data.
Returns:
A str of length `size` with the bytes converted into a string of bits.
"""
@prschmid
prschmid / moviepagemaker.py
Created November 11, 2012 17:51
Create a 'pretty' webpage for all of the moives in a directory by getting the movie poster from IMDB.
#!/usr/bin/python
"""
Create a 'pretty' webpage for all of the moives in a directory by getting the
movie poster from IMDB.
Since it depends on the OMDB API, not all posters that are returned are correct.
That being said, it's good enough for a start. =)
"""