A young man who stole two bicycles was trying to pay off a drug debt at the time.
David Cooper (22) was caught by gardai crouching behind a car after they were called about a suspicious man in a garden.
A solicitor said Cooper was seriously assaulted last year in what was "a life-threatening and life-changing attack".
In Blanchardstown District Court, Gda David Shorthouse said he was on patrol shortly before 2am last June 18 when he received a call about a suspicious man in a back garden.
When he arrived at Rathmore Crescent he found Cooper crouched behind a car.
Gda Shorthouse said Cooper had a pair of bolt-cutters in a back pack and admitted that earlier in the evening he had stolen two bicycles.
The officer said Cooper co- operated fully.
The court heard that Cooper has five previous convictions.
Defence solicitor John O'Doherty said Cooper "held his hands up straight away" and brought the garda to where the bikes were hidden.
Mr O'Doherty said Cooper had a drug problem at the time and was trying to pay off a debt.
The solicitor said Cooper was seriously assaulted last October year, and he lost the sight in one eye.
Mr O'Doherty said the defend- ant was on life-support for more than a month, and he handed a medical report on Cooper's injuries into the court.
He said Cooper's life has completely changed in the past eight months. He is now drug-free and is focused on remaining drug-free.
Mr O'Doherty also said that Cooper, a father of two young children, was unemployed, but he had applied for a security licence.
The defendant, of Dromheath Grove, Mulhuddart, admitted in court to possession of a pair of bolt cutters for use in a theft at Rathmore Crescent, Tyrrelstown.
He also admitted two counts of unauthorised taking of a bicycle at Curragh Hall Green and The Boulevard, Cruise Park, both in Tyrrelstown.
Judge David McHugh ordered Cooper to complete 60 hours of voluntary work and imposed a three-month sentence suspended for a year.