“Tao of Rodney” is the episode fourteen of season three of Stargate: Atlantis.
Whilst exploring Atlantis turning off any devices left on by the Ancients during their brief ownership of the city before being killed off by the human-form Replicators, Rodney McKay is accidentally zapped by an Ancient device.
He acquires a number of new powers and starts getting smarter. The device turns out to be something designed to help Ascension. Unfortunately, there is a side effect – if you don’t Ascend, you die.
This episode shows us a different side of Rodney, rather than the usual arrogant one as, with his death approaching, he starts doing nice things for people and apologising to them for his prior behaviour. This probably won’t last.