A working in the publishing industry started selling cocaine after his hours in work were cut, a court heard.
Andrew Kellett (37) was moved from a five-day to a two-day working week and he found it difficult to pay his bills.
He initially tried to flush the cocaine down the toilet when gardai raided his north Dublin home, but he later co-operated with them.
Judge David McHugh convicted and fined Kellett €250, saying the defendant had co-operated with gardai though it was "late in the day".
The incident took place at the defendant's home at Melville Square in Finglas on December 16 last year.
Kellett also pleaded guilty to obstruction under the misuse of drugs act at the same time and place.
Garda Sergeant Maria Callaghan said that gardai obtained a search warrant and searched the defendant's home shortly after 7am on December 16, 2015.
Sgt Callaghan said that Kellett initially tried to flush the cocaine down the toilet, but he subsequently co-operated with gardai.
The sergeant said Kellett made full admissions in relation to owning the cocaine.
The street value of the cocaine was €545, said Sgt Callaghan.
The court heard that Kellett has one previous conviction, for a road traffic offence that dates back more than 10 years.
The defendant's solicitor said that Kellett signed the garda's notebook accepting ownership of the cocaine.
The court heard that the defendant is separated from his partner and he has a young son.
At the time of this incident, Kellett was going through "hard times financially", said the solicitor.
The court heard that the defendant worked in publishing, and his hours at work were cut, first to a three-day week, and then to a two-day week.
The solicitor said that Kellett found it very difficult to survive on his earnings of €1,000 a month, particularly when his rent was €800.
He also said the defendant wished to apologise to the court for his behaviour, adding that Kellett had "no excuse" for what he had done.
The defendant admitted before Blanchardstown District Court to possession of cocaine as well as having the drug for sale or supply.
Judge McHugh imposed a €250 fine.