A lot of things. Last year I had this girl I would always talk to, and that kept me sane. But that broke down over the summer and now the feeling of being purely single helps. Aside from that, different things keep me sane through different parts of the day.
Waking up: I wake up at about dawn, so when I wake up, every day I say "Look to my coming on the first light of the fifth day, at dawn look to the east." It starts me off in good spirits.
During school, I am kept sane by the fact I have but one more year in high school, and then I'm done.
Doing homework: I am kept sane by thinking that this is as easy as its going to get, so enjoy it. I think that pretty much every day without fail.
I also try and fit in a lot of other smaller things, like reading and writing, which really help me in the long-run.