Anyone know of any decent apps out there that one could use to store pieces of code we write that we can later reuse? I find myself scouring through old projects from time to time looking for some function I previously figured out, or some class that was - at the time - a stroke of genius lol ... but that search process can be a tedious one. If I had an app that I could use where I see that I've written a class or something and realizing I may want to use it in the future, it would be nice to have all that in one place where I could categorize it etc.
I did some Googling around on the topic but I didn't find anything. I'm sure I'm not searching with the right verbiage.
There are some web sites out on the Internet that specialize in code snippets, although they are often just brute-force scourings and frequently repetitive.
And of course, there's our good friend StackOverflow, which is another resource for code that's more or less ready-made.
One thing you can also do is make libraries out of your useful classes and store them in a local Maven repository such as Nexus. Pair that with an in-house source repository. I use Gogs, as it's easily run in a Docker container.
For personal snippets, there are resources in many IDEs. In particular, I keep both snippets and templates in Eclipse.
And for a simple roll-your-own free-text search, you might set up a directory tree on a fileserver and embed the snippets along with their documentation in markdown files. Then you could index them with a program such as Recoll. While I use recoll on my desktop, there's also a web UI that's usable for sharing a recoll database with multiple users.
And, of course, don't forget JavaDoc. It can be used to build websites from well-documented code.
Sources may include data from the Fakebook Research Foundation with support from Gargle University