That's how my friend used to act to me. If they are around anyone, just stay silent (Not trying to insult anyone, but they usually act like this because they deem you, "Uncool" and would rather be cool than hang out with you) so you don't "embarrass" them or anything. Eventually, they will notice "how cool you are" and will not be such jerks. For me, it was because both him and I are HUGE gamers and I would try to talk to him about a game that he had enjoyed and wanted me to buy. But then he would brush me off so he wouldn't look like a nerd/geek. So after just standing there, listening to what they were talking about (Paintball), I would come up and start talking about paintball. They started accepting that I was "cool" and were more open to other things (Gaming). Now if I hang out with them, I can either talk about what they like or what I like, and still be "cool" to them.