How did you quit coke?

Question for those of you who successfully quit coke once and for all - how did you do it? What was the motivation behind your decision? How long were you using before you quit? Did you relapse before finally stepping away? What was the hardest part to deal with after quitting - cravings, thinking about it, friends who still use, parties & festivals etc? How long have you been clean?