Many things have already been said here, one I haven't seen is (basic!) Mindfulness - no psychotherapists or other psychos involved. Just self-paced, listen to a 5-min mp3 once or twice a day. This one: https://www.amazon.co.uk/Mindfulness-practical-guide-finding... comes with a good free app (book is OK, but written by a professional, so not airy-fairy).
Unlike my vegan childless friends, I don't have the time to go on retreats or walk barefoot on moist grass, but I do have 5 mins to breathe in peace, in work breaks for instance. I'm not sold on Mindfulness as a cure for everything from obesity to cancer, but it sure helped me gain a new perspective on life.
The basic premise is, our minds have an autopilot of thought tape. These thoughts tend to gravitate to negative, angry, protective thoughts and emotions. It's not that hard to break that loop though. This "stream of consciousness" is not objective, but rather a very biased resampling of our experiences. With minimal training, you can recognise it and refocus it.
For example, I used to often fume about work annoyances on my way home from work, thinking about e-mails I received, or what I'd respond next time, etc. With some Mindfulness under my belt, I can just switch it off. Look out the window of the bus and genuinely enjoy not changing nappies right now. Or when that infuriating guy from sales sends you another e-mail, and your brain serves you the many angry memories of past interactions, recognise that, separate the memories from the e-mail that really just needs an "ok, I'll look into it" response, and you can get on with your life.
It doesn't make the world an easier place for you, but it helps you focus on the good bits that are already there. As a new parent, you probably don't have the time (or sufficient sleep) to pick up a new hobby, but 5 mins most days is feasible. And, chances are, you might discover there are nice moments in the day, when your mind isn't flooding you with memories of the bad stuff.
That, and also: when we had 1 child, my wife and I tried to look after them together, always. We now figured having some "you time", as others say, is invaluable. 2 hrs of looking after a child on your own, plus 2 hrs of time to yourself, is a huge difference. Just sit and chill and watch Netflix if that's your thing. Or do the weight lifting / running / skydiving in that time. Did wonders for me.
To save you the pain of my journey (although perhaps the pain is a necessary prerequisite?) I can tell you that what has worked for me is engaging in Mindfulness and having sessions with an expert in Transactional Analysis. Transactional Analysis teaches you to realize you are not just one person all of the time but instead have multiple "Ego States" that you will move through depending on various circumstances. TA has deep scientific grounding and I have found it the only way to explain myself to myself clearly. Understanding TA (with the help of a therapist) can give you some explainations as to why you think, feel and do the things you do.
There is a LOT more to all this but I encourage you to read a couple of books and perhaps reach out to a therapist that specializes in TA for a couple of introductory sessions and see if it works for you.
- Mindfulness: https://www.amazon.co.uk/Mindfulness-practical-guide-finding...
- TA Today: https://www.amazon.co.uk/Today-New-Introduction-Transactiona...
http://www.amazon.co.uk/Mindfulness-practical-guide-finding-... (Mindfulness: A practical guide to finding peace in a frantic world, Prof Mark Williams and Dr Danny Penman)
It's a great book that leads you through the first 8 weeks of meditating, and contains meditation aid audio clips for various scenarios. The most useful I've found is the 3 minute "breathing space" meditation, particularly for that noisy bus - you need good noise excluding ear buds though.
If you don't like the speaking audio, and/or you've practiced enough not to need the prompts, you should check out Simply Noise:
http://simplynoise.com/ << they also have apps for phones.
I've found it equally helpful for rendering words unintelligible, which makes mindful awareness much easier.
1) don't waste cognitive energy on silly tasks (games, arguing in comment threads, etc.)
2) practice exercising willpower - it's a muscle, you can train it to be better. Start by forcing yourself to complete a routine every morning (the trick with habit forming is to not give up after you miss a day.) examples of habits to form below.
3) look into mindfullness meditation - this can help you identify distracting thoughts as they arrive and practice ignoring them.
Meditating is a good habit to form as practice, and it will also help you get better at habits. You could also exercise on a schedule (and record when you do, including how heavy you lifted/how fast you were running). Eventually, with a stronger willpower-muscle, you'll be able to choose the fruit salad over the cake, even when you've just spent your 7.5 hours a day coding.
I've not found pomodoro to work for me as an easily-distracted person, it's better when you're prioritising work tasks (e.g. 25 code vs 5 email) and even then, 25 mins is too short for good programming "flow".
This is a hard problem, everyone has trouble with it. Good luck!
 http://seriouspony.com/blog/2013/7/24/your-app-makes-me-fat (HN discussion: https://news.ycombinator.com/item?id=6124462 )
 http://www.amazon.co.uk/Mindfulness-practical-guide-finding-... (US edition: http://www.amazon.com/Mindfulness-practical-guide-finding-fr... )
Depending on where you are, you may need to wait to get an appointment (I had to wait 4 months to see a CBT worker on the NHS in the UK) so in the meantime, you may want to try this book:
Which is an 8 week course of ways to meditate to practise breaking the negative spirals of thoughts.
My partner and I are currently working though it, and while it can seem like it's talking down to you some of the time (especially if you're a geek like me) you should persevere, as the actual conclusions, practical advice and meditations are very helpful (and have been shown to work in clinical trials.)
Good luck, life gets better than this! :)
Fresh book recommendations delivered straight to your inbox every Thursday.