I have struggled with depression since I was a small child, also I am an insomniac. I find the best solution to defend against "feeling blue," has a lot to do with what happens the day before whether it is a highly stressful environment at work or not.
1) Make sure after work you get yourself clean and do something social, just to get you relaxed and if you have a really close friend, spouse, or significant other you can share with them your thoughts and listen to them too, and maybe even daydream with them a little (slightly flighty I know, but hey whatever works, works right?). Keep things light hearted for the most part, and hopefully if your partner in this situation has a problem, you care enough to help them without getting too emotionally invested in their problems. It might feel good to help out.
2) With all of the craziness of the day, make sure before you go to bed with a clean conscience and a satisfactory demeanor. Once again you can socialize. Email, phone, instant messaging can be good. Or you can watch a funny movie, tv show, spend time on your hobby. Just really anything that clears your head so you can actually get to sleep.
3) It is extremely important not to get emotionally committed in others' affairs, and as far as to with one's self, you need to filter out what is important and what is petty or trivial. Days really aren't long enough to live life as most would like, and people who may have the tendency to take indirect negative comments to heart may struggle a bit still. But if that ever happens just focus on your work and it can be so self rewarding knowing that you worked so hard and did your job well and having beaten the down.
4) Make sure you eat!! Take breaks, drink coffee or tea or water, have a muffin, a whole grain bagel, something with complex carbs that will keep your energy balanced throughout the day, at lunch actually eat a decent meal. Keeps the energy up and thus keeping a more positive attitude for the last half of the day.
5) As for bullying I find if someone says something negative to me I'll snap back with an empty compliment (eg. nice shoes, they're very *pause* clean) which sends them for a spin because they're trying to figure out if I was being sarcastic or not and it's kind of funny looking back and they're looking at their shoes trying to find a smudge or stain. Just completely ignore them otherwise, or laugh it off, as they may be just dealing with their own stresses by lashing out at others. Try to keep a good sense of humour about it.
6) Often people in an office situation aren't too fond of others in the workplace. There are usually small circles of friends but that's about it. Just know we're all in the same boat whether you like it or not, and think what you will of others, but keep it to yourself, and try not to worry so much about what others think of you.
7) Rely on yourself and stay confident. Reading popular magazines like People, Cosmopolitan, other pop-media outlets and tabloids can be a horrible pitfall for many individuals as it often demoralizes self-esteem by presenting hyperrealistic (tampered most of the time) imagery of both genders and really has an adverse effect in the work place. As far as gender issues go in general, don't listen to female advice about males, and don't listen to male advice about females, anything they are right about is usually a lucky guess or at best someone talked (how dare you give away our secrets! And yes I'm not ashamed, I've read a few cosmos in my day, guy without his shirt? I have not once met a man who looked anything like those pics no matter how much time they spend at the gym and no matter how healthily they live unless they're a body builder, who often do not live healthily, or fitness trainer with an unusual body structure).
8) This is just a suggestion, not for everyone. Take time out to daydream. We all do it sometimes. But it really works like meditation. Basically fantasize about doing something amazing, great, and meaningful. It'll make you feel good, and keep you driven until you eventually forget about it. Just don't rely on it on a deep emotional level because I know some (myself included) tend to get extremely disappointed when plans don't work out.
9) Dealing with tragedy. If you need time for bereavement...then take time off. A week or two at least. Do some soul searching. Most employers will understand depending on the situation. And you know eventually you're going to get the itch again and feel like you need to go do something with yourself, and end up going back to life as you knew it.
Everyone has their own strengths and beauty, find out what they are and utilize them to your potential and that will cultivate growth. Follow your heart but don't be stupid.