Judge resigns after using racial epithet, opining that all lives matter