Skip to content

Instantly share code, notes, and snippets.

Avatar

Patrick Schmid prschmid

  • Cognitive Genetics
View GitHub Profile
@prschmid
prschmid / idsentence.py
Last active May 4, 2021
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/
View idsentence.py
"""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 Jan 3, 2013
A simple helper function that takes some input data (bytes) and converts it to a string of "bits" for debugging purposes.
View bytes_to_bitstring.py
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 Nov 11, 2012
Create a 'pretty' webpage for all of the moives in a directory by getting the movie poster from IMDB.
View moviepagemaker.py
#!/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. =)
"""