Great read and I've seen this work directly in my life for the 20 years after I heard this advice for the first time. There's no avoiding it. Someone is going to treat you terribly for reasons you don't deserve and most of the time and you can't "patch" the other guy/gal.

I was the youngest member of the team by 6 years at the company I started my career[1]. I was treated like a kid (often called a whiz-kid, but not in a flattering way). I worked with sysadmins, several of which had terrible attitudes and all of which were at least 5 years my senior. Three were outright bullies and made me hate a job I would otherwise love. A coworker told me "treat them with undeserved kindness" and quoted a bible verse about it being like "heaping hot coals over them". I wasn't a Christian so the bible didn't have the authority that it held for him, but after a long talk, I understood the usefulness and decided to run with it. It came down to "whether or not the abuse is deserved, you can't make the other guy do something different, you can only control yourself".

I became the guy who was kind to "the 3 jerks". I'd find things to do for them -- volunteering to swap tapes, noticing how coffee was taken and bringing an extra back when I refilled[2], twisting received backhanded compliments into compliments (with inappropriate thanks), and apologizing about things they complained to me (and about me others) seeking advice on how to do better[3]. My behavior toward "the jerks" spilled over to everyone else. One of the 3 bullies became my defender and friend (I got the impression he was a jerk to fit in at the time but such is not the case today).

I really liked the description of what happens to you when you decide to put this attitude in action. The more you do it the more comical grumpy, angry people become. The phrase "it must suck to be you" sarcastically rang through my head occasionally. The two remaining bullies, however, behaved how I've found most bully-types behave when I'd ceased to be a reliable target. "Heap hot coals" was a perfect description. They became bigger jerks and their behavior spread out to everyone. I was picked for projects over them because I was seen as kind/friendly while they were stereotyped as BOFH. Coworkers saw the undeserved abuse given me by "the jerks". On the same day I received a promotion, they were laid off (and I was told directly that it was due to their terrible attitude and the way myself and my advice giving coworker were treated). I became a much happier person in general. Thinking about it now, it's strange to think that happened because I chose to accept abuse and be kind, but it was.

[1] I was 19 doing sysadmin/infrastructure support for a telecom - most of my coworkers were over 25, many over 35.

[2] I remember grabbing myself a cup of coffee and filling up another cup for my coworker, prepared the way he always took it, and having him say "sucking up to me, now, are ya?" and then complaining that it had too much sugar. My boss was in the cube next to his at the time and overheard the conversation. He stopped by to apologize for this employee's abuse and asked me why I was being so nice to him. I don't remember my response.

[3] This was the only hard part - swallowing my ego. Experience has taught me that Sysadmins/Devs have strong opinions about things that are as important as the color of the bikeshed. I'd be denigrated for not following rules that were unwritten (and not followed by these individuals) and trivial (i.e. tabs vs spaces where "wall of pink" doesn't apply) and having to ask how I could do it "better" while swallowing the screaming in my mind that said "Seriously?! This is what's so important?!!"