Funny this topic cropped up again since I'm building a circuit which would require a diode for a very special purpose.
When the PI shuts down it doesn't kill the power to the USB ports so I'm creating a digital switch involving a relay that will self power down when the PI powers down.
Anyone who has built transistor circuits involving relays will notice there is a diode connected in parallel with the relay coil.
This is because when the coil is active and then stopped the collapsing magnetic field creates nasty voltages in the opposite direction high enough to give you an electric shock.
Transistors do not appreciate having current flowing in the wrong direction at such a high voltage (reverse bias) and in some cases may damage.
The diode connected at the relay coil makes sure the transistors are not subjected high voltage reverse bias damage.
Other uses for diodes are:
emitting light i.e. remote control
detecting light i.e. remote control
dropping voltage (poorman's regulator)
voltage reference in regulator circuits
poorman's voltage regulator zener diodes
connecting two power sources together with 2 diodes that may not at the same time have the same voltage output.
battery backup circuits i.e. clock radios that need to maintain the clock in the even of a power cut.
radio circuits detector stage (look up crystal radio)
variable capacitor (varactor) radio circuits tuning or at the transmitter modulation stage
rectifying AC to DC
transient suppressors - protect equipment from power supply spikes
voltage protection i.e inputs of amplifying equipment or digital meters
temperature detection circuits.
tunnel diode - microwave oscillators
lasers - perfect for tormenting next door neighbour's cat.