Magistrate resigns after violent courthouse fray