Aaron Randall has created a cool new app called Screentendo that allows you to turn anything on your computer into a playable level of Super Mario Bros. On his blog, he gives a detailed description of how it all works, but he built it using an app called Cocoa and a Sprite Kit. Here's a brief explanation of what it does:
When Screentendo is launched, a semi-transparent window appears which can be moved and resized over other application windows. After placing the Screentendo window over an area of the screen, clicking inside the window will cause the app to render a game level based on the content beneath it.
See it in action below.