Patrick Rauland recently decided to leave (drama free) from Automattic, and he details his thought process.
Patrick cut his expenses, planned how to bring in revenue, and generally got ready to go before he actually left. I realize not everyone can do this (or wants to plan ahead this much), but I enjoyed his approach.
Of course, we all make mistakes, and in his effort at radical transparency, he shares his first one.