The term nerdsnipe originates from a 2007 xkcd webcomic, perhaps inspired by a real-life anecdote from John Conway, the inventor of Conway’s Game of Life. As with all xkcd webcomics, additional background information can be found at its associated explainxkcd article: https://www.explainxkcd.com/wiki/index.php/356:_Nerd_Sniping

One thing I appreciate about the term is that it’s a microcosm of how English compound words are created. In the originating comic it’s spelled “nerd snipe”. Three years later, the same author spells it “nerd-snipe”. I don’t have a good date on the unhyphenated version, but I can see that I was using the spelling “nerdsnipe” by at least 2018. One interesting point of comparison is when news outlets and style guides started dropping the hyphen in “email”, and extrapolating that most people probably started dropping it a few years before that.