• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Any decent apps out there for storing code snippets?

 
Ranch Hand
Posts: 167
1
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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.

Thanks,

Mike
 
Saloon Keeper
Posts: 24287
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suppose it depends on how you want it.

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.
 
Marshal
Posts: 22446
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about https://gist.github.com/discover?
 
reply
    Bookmark Topic Watch Topic
  • New Topic