Prepare for It. Like the situation above, you should go into the conversation knowing how you'll respond if your boss asks you to extend your notice. If you've landed another job offer and have already set a start date, this may not be possible__so practice sticking to your guns: "Because I have a new opportunity lined up, my last day here is firm.
A Gracious Tone. Your resignation letter is not the time to air grudges, take passive_aggressive shots, or otherwise be unpleasant. Regardless of how you feel about your (soon to be former) job or your boss, this letter should be an exercise in professionalism and graciousness. An excellent way to do that is to say a simple "thank you." Even if you hated your job, you got something from it at some point. Focus on that positive bit if you need to.