Huddersfield man admits two offences at magistrates' court