I don't care what you want to call it; "depression", "desperation", "determination". All I can tell you is that if you are convinced (not "worried"; we all worry sometimes) that you're a "loser" or that this is your "last chance" to do something meaningful, that's not normal. If you were a friend of mine, I'd be hassling you to find a professional you could trust to work that stuff out.
Hey, either way: best of luck to you. Your career will be fine.
You are not your WORK (fuck pointers in C++)! Chances are that you're awesome at things you are refusing to acknowledge! Come here I'll give you a hug! (Then slap you!* ... because you're wasting time worrying about judging yourself instead of CREATING things and moving along!)
* Ok, I just slapped myself because I'm wasting time on HN! ;-P
Your life isn't going to get back on track until you start thinking better about yourself. The reason you're so self-absorbed right now is because you're constantly beating yourself up; its a full-time job. Once you can have a little self-esteem and equanimity again, its going to be a lot easier to think of others and work projects and be able to achieve your goals.
At the very least go on vacation, or move; its easier to get out of ruts if you're somewhere new and different, for neurological reasons. Go somewhere new and remake yourself closer to the person you want to be.
If you do nothing besides trying the same thing you've tried dozens or hundreds of times before, that's what's really worrying and dangerous. :-(