First of all, it helps if you can realize how ridiculous and out of line they were. Sounds like you've got that.
Second - I can't do this myself, but I've heard it works - is to forgive them. Like your landlord, obviously had some sort of power struggle or jealousy issue and attacked out of no where. You did nothing. He clearly had some stuff of his own going on. If you can forgive him for making the mistake of taking out his stuff on an easy target, that will help. Or so I've heard.
Next you can reroute your thought patterns. Your thoughts go through your brain like roads through the countryside. You keep thinking one way, the road becomes a superhighway, and you automatically go down it without even noticing that there are other roads. Take the other roads.
For instance, it appears you had a v bad time in that apartment, that all you can focus on is how you got there. But, it's also true that you pulled yourself up by the bootstraps and survived. That was not automatic, that took work. So those two roads are parallel, going in the same direction. You hop on the superhighway, your parents, and ignore the relaxing road just over to your right, what you did for yourself.
Finally, mindfulness helps, so you can stay in the here and now and put the past out of your mind for a bit.
This is all too simplistic sounding. I'm sorry. It does work, but it takes a lot of effort. I wish I had a magic bullet for you - that wasn't a bullet.