IANAL -- If you talk to a lawyer, which I think you should -- stick to the racism and sexism. Start documenting exact quotes. The lawyer will probably advise you to talk to HR, and their job is a lot easier if you have a journal (date/time/quote and context/list of those present).
Also, I think it's a good idea to not post on HN about this -- if it comes to a lawsuit, you could be asked about it, and nothing you say here or on forums can help you.
Also, stuff like this:
> I was listening to music with my headphones and he's like "WHO'S LISTENING TO THAT?" and then asked me to lower the volume because it "distracts" others.
is pretty reasonable -- perhaps not the exact style, but if the office culture is quiet (which it should be for programming) and they can hear music leak from your headphones, it is a distraction.