The TV-B-Gone is a neat little device that can turn almost any TV on or off. It uses a microcontroller hooked up to IR LEDs to output a library of on/off codes. Adafruit sells a kit, and has the code as well as the schematic on their website.
Here’s a micro clone of the TV-B-Gone that runs on a coin cell battery, is slightly bigger than a quarter, and costs about $3.50 (compared to $20) to make!
Source: dark sponge