This website is a minimal reference implementation of the masonry layout.
Click here to view the source code on GitHub.