A shoplifter and a man who armed himself with a hammer were among defendants sentenced recently at York Magistrates Court.