I've been writing markup and code since the mid-1990s and I have never found cheatsheets or snippet palettes particularly useful. If I use a piece of code often enough that it's worth adding to a snippet palette in my editor, I likely already have it memorised anyway. If I don't remember what a function is called or what its signature is supposed to be, a quick google is about as fast as digging up a cheatsheet that may already be outdated and irrelevant.
It's generally a bad idea to keep code around for copy-pasting -- it either means you are planning to write code you don't actually understand, or that you're repeating yourself too much and should consider refactoring or using better abstractions.
That said, sometimes I run into code snippets on the web that I want to keep or I write snippets of code that are fairly specific but might be useful in the future but are hard to memorise or look up. I recommend using GitHub gists for these. Additionally I try to use browser bookmarks to keep track of documentation or libraries I might find useful but would likely forget about otherwise.
There are two exceptions however: I keep a file around with the exact docker commands I used to create each container because these can be a bit intricate and annoying to deduce after the fact; and I stick helpful bash commands in my .bash_aliases file (which I prune every now and then to get rid of stuff that seemed useful at the time but I never really ended up using).