Optometrists would probably be horrified if they found out, but I keep an old neodymium hard drive magnet stuck to the hinge of my bathroom cabinet for just this purpose. As soon as I realize I've got metal in there, I just hit the bathroom, pry the lid open, and the magnet snags the shaving...