A cyber security professional whose ex-partner reported him to police for shooting up heroin behind the wheel has been banned from driving.