Khalel Siddique Ahmed (34) admitted possessing heroin with a street value of up to £42,000 with intent to supply it and possessing cannabis resin worth £100.
The court heard that police had searched his flat in Liberation Court on 23 August 2004.
They found cannabis in the master bedroom and heroin in the kitchen bin.
Crown Advocate Sally Sharpe said: ‘The defendant claimed that his girlfriend had been angry about the heroin and told him that he must choose between her or his drugs.
This is why he says he threw the bag of heroin away, not down the lavatory or in the sink, but in the kitchen bin.’ She said that Ahmed was at high risk of reoffending, and had admitted that he sold drugs to fund his £500-a-day heroin habit.

