A shoplifter who stole vitamins, sunglasses and clothes in a spate of thefts had been abusing cocaine and pills at the time.
Scott Byrne (29) had since gained more "maturity", got clean and become a new father, a court heard.
Judge David McHugh ordered him to carry out 200 hours of community service instead of a five-month prison sentence.
Byrne, with an address at St Ronan's Close, Clondalkin, pleaded guilty to multiple theft charges.
Blanchardstown District Court heard the accused went to Boots in Liffey Valley Shopping Centre at 5.15pm on July 3, 2017.
He took €57 worth of vitamins and sunglasses, passed all points of payment and was stopped by security when he left the store.
Gardai were called and he was charged. Separately, Byrne took €80 worth of clothing from Dunnes Stores in Liffey Valley on April 12, 2016.
Again, he was stopped as he left and the goods were recovered.
He also stole a €150 jacket from Dunnes Stores and €48 worth of items from B&Q in other incidents in 2016, a garda sergeant said.
Byrne had a number of previous convictions for offences including possession of drugs.
The accused had recently become a father which had brought more maturity for him, his solicitor Luke Staines said.
At the time of the thefts, Byrne was abusing alcohol, tablets and cocaine.
He had done a drugs course earlier this year and had been clean since, Mr Staines continued.
Byrne was now clean of all substances and working full-time as a cleaner, the court heard.