I bought this awesome Simple Human trash can last year that uses grocery bags. It is an all in one unit meant to be screwed to the back of a cupboard door, but the cupboards below the sink are too narrow and the bag holder would hit.
So the unit has been sitting next to the refrigerator but loosely, which meant it would fall over when you used it, etc.
So I ordered 4 12lb rare earth bar magnets from these guys and they work perfectly. $10 and I put two on the top frame, two on the bottom frame and the trash unit is firmly attached to the refrigerator.
Nice!