On a serious note, honestly telling the problems and difficulties one have is the best approach, even if that means telling that a better job offer was given. It's the most proffesional way of handling this situations. If someone starts using "low" methods just to get fired, it leaves a bad impression to the other developers and the rest of the company employees. No one can stop you from leaving the company you work for, with or without cancelation period, but that doesn't mean you should close your doors because of it.