Skip to content

Instantly share code, notes, and snippets.

@dprea
dprea / IIFE - Encapsulation Reference.markdown
Last active February 12, 2016 04:44
IIFE - Encapsulation Reference
@dprea
dprea / png_encoding_reference.md
Last active February 14, 2016 23:18
PNG File Encoding and Reading

Extending the correct answer from SigTerm, here is some background of why you got the effect you did for opening a PNG file in text mode:

The PNG format explains its 8-byte file header as follows:

The first eight bytes of a PNG file always contain the following values:

   (decimal)              137  80  78  71  13  10  26  10
   (hexadecimal)           89  50  4e  47  0d  0a  1a  0a
 (ASCII C notation) \211 P N G \r \n \032 \n