A 25-year-old was found with drugs in his socks when the vehicle he was travelling in was stopped by police.
Richard Ismail of Thackray Street, Pellon, was a passenger in a car pulled over for driving at speed by police in Commercial Street in Halifax town centre on April 23.
When searched by police, it was revealed that Ismail was wearing two pairs of socks.
Between the two pairs was £20 in cash and two small bags containing white powder, Mephedrone, with is more commonly known as M-Cat.
Ismail admitted to police that he was the owner of the drugs, and that he bought the drug for his personal use.
Calderdale Magistrates heard how he suffered from depression and used the drug to calm him down.
He was given a conditional discharge for 12 months and told to pay £85 costs.