Did that to a roommate once. The school provided new desk lamps. The socket was behind his desk where he couldn’t see it. Unknown to him I inserted an flasher between the socket and the lamp plug. If he would have left the lamp on he would have seen it flashing. Unfortunately for him he kept turning the switch on and off disrupting the pattern.
I about busted a gut trying not to laugh.