Ferromagnetism does both, attracts and repels, but only certain materials are ferromagnetic.
It's not gravity BTW, it's magnetism.