kazinator
today at 7:32 PM
I have an electric guitar which has an uncovered electronic cavity in the back, where the volume pot is mounted, and all wiring passing through it. I have a DPDT sliding switch there which is just held by hot glue to the side of the cavity, and recessed in a bit so that it isn't accidentally moved. It's been that way for years. From time to time it used to come off spontaneously, requiring a re-gluing, but I learned to do it better.
When redoing the wiring for one reason or another, it's trivially easy to peel the switch off with a screwdriver and remove the glue.
There isn't a compellingly better way of attaching that switch there. It has mounting screw holes but they point in the wrong direction, into the cavity. To screw it down, I would need some sort of long risers that somehow attach to the bottom of the cavity and are firm enough to resist the side to side push. Little L-brackets could work that attach to the side of the cavity. It's a very small cavity: hard to screw such brackets in, but that can be solved. Even if the brackets themselves were permanently mounted, not having to be removed when the switch is taken out, it would still take more time than with the glue.
Another use I have for glue is to secure a household internet connection. It's just a thin wire coming out of a RJ jack in the wall, in a room where kids play. The installer didn't crimp the plug into the cable insulation. The situation is that the insulation ends a few millimeters before the RJ plug, leaving a couple of bare wires that seem like 22 AWG crimped in.
I "kid-proofed" this with hot glue. Hot glue is all over that plug, and about two feet of the cable is basically encased in hot glue, attached to the switch plate and along the wall right until the point it goes behind some furniture. I check on it from time to time to repair any tearing away.