Start a code library. As time goes on you will collect code snippets, hints and tricks from all over the net. So why not use Python to store these cut and pasted pieces of code in a file.
Attach a title and a set of keywords to each snippet that allows you to search the file and retrieve the code easily. You might want to use just one file and keep appending, so you have to find a way to keep the snippets appart from each other within the file. I have done it with a list where the items were separated by a dotcode-marker, works well, but it may not be a good way.
You can search the file directly or load the file into a list to speed things up. I leave it up to you. Keep thinking!