169

I love GitHub and their gist service, and that's why I'm keeping a lot of code snippets and even development notes as a gist on my GitHub account. It also makes it easy to share them with my colleagues.

The problem is that it doesn't scale!! The GitHub features for gist are primitive, and I have lots of gists there which make it really difficult to find some of my old gists. There's no search, no tagging, or anything.

Do you know any application that can handle this mess? I would like an application that could

  • Search my gists
  • List my gists by source type and date
  • Let me edit or copy them
  • Let me tag or at least edit description

I would love to see something like this, and I'm willing to pay even some bucks for it.

So how do you manage you gists on GitHub? Do you know any software?

There's one called drift written in MacRuby, but I couldn't compile it, and it hasn't been updated for a while.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Allen Bargi
  • 14,674
  • 9
  • 59
  • 58
  • Maybe this guy will add gist management: http://www.kickstarter.com/projects/1487030260/hubcap-a-github-client-for-mac-os-x – pjmorse Dec 03 '10 at 22:16
  • 1
    Note, as I mention [below in my answer](http://stackoverflow.com/a/14746157/6309), since February 2013, `https:///gist.github.com/Username/` is a possible url to easily find any user's gist. – VonC Jul 07 '13 at 18:50

11 Answers11

125

Check out GistBox. It supports searching, editing and labels. Here's a screenshot:

GistBox Interface

There's also a demo video at: http://www.youtube.com/watch?v=VLgyY6lqpsQ

GistBox Clipper (a Chrome extension) also provides the ability to save <pre> tags and arbitrary text on any web page.


Edit:

Unfortunately, GistBox is becoming Cacher cacher.io - the free plan will only include: 15 private snippets, 3 private labels, unlimited public snippets. If you plan on having many private gists then you will need to but (sic) a paid plan. – Bartek Skwira

vgoff
  • 10,980
  • 3
  • 38
  • 56
Suresh
  • 1,925
  • 1
  • 18
  • 21
  • Truly awesome! Searching + labelling were the only things missing in Gists. I have been checking out other similar services but none of them fitted my needs. Thanks for sharing! – Bartłomiej Skwira May 24 '13 at 09:49
  • We use an enterprise version of github for our org, is it possible to use this with that version? – Venki May 27 '14 at 15:33
  • 1
    the search function is not as good as I hoped. – Claudiu Creanga Mar 19 '16 at 12:00
  • I agree with @ClaudiuCreanga The search function is not deterministic. For example: I type a word in search bar and no gists are found. Then I myself open the gist which has this word in it. Then I again try step one and search for that word. And ...now magically the gist can be found. Weird :P GitHubGist search described below by weakish works better. – Mateusz Apr 01 '17 at 10:16
  • 8
    GistBox will be inaccessible starting December 1st, 2017. – Cologler Sep 06 '17 at 13:51
  • 12
    Unfortunately, GistBox is becoming Cacher https://www.cacher.io/ - the free plan will only include: 15 private snippets, 3 private labels, unlimited public snippets. If you plan on having many private gists then you will need to but a paid plan. – Bartłomiej Skwira Sep 08 '17 at 12:55
  • Ruined by stupid subscription models. – ninjaneer Jun 13 '19 at 07:46
  • Above 2 are no longer working. I recommend Gistpad - integrated in VSCode https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs – Sagar Mhatre Jun 19 '23 at 03:02
68

Now gist.github.com supports search. So you can search your gist. I use #hashtag in description, so I can search my gist by tags via user:myusername #tag.

For offline usage, I cloned all my gists. And use find and grep to search them. I also search them with gonzui (open source code search engine).

I've written a shell script: gister.sh. I use it to post gists. It will clone the repo to local and import into csearch automatically after the post. The script also supports sync all your gists (gister sync).

https://github.com/weakish/gister/

weakish
  • 28,682
  • 5
  • 48
  • 60
  • 3
    Nice tip on including your username in gist searches to narrow things down (since they only have a search for all gists at the moment). – Derek Morrison Apr 26 '11 at 08:39
  • 5
    Note that you can now use the `user:` prefix provided by gist search: e.g., "user:myusername #tag". – Kristopher Johnson Jul 22 '15 at 18:03
  • Nice tip indeed, thanks. The recommendation to use `user:myusername` combined with a keyword search allows finding gists that would otherwise require clicking the "Older" button 100 times. – tresf Aug 03 '16 at 18:16
  • 3
    Awesome! in chrome you can right-click the address bar > pick *Edit Search Engines* and click **ADD** to add gist search as a search engine: `https://gist.github.com/search?utf8=%E2%9C%93&q=user%3MY_GITHUB_USER+%s`. Set `gist` as a keyword, so now you can type `gist` in the address bar, press space and type your query. – ccpizza Oct 27 '17 at 10:05
  • 1
    I like this Answer best for it's use of offline search as well, and gister.sh looks interesting. Github also has a list of all the search prefixes available from the search page, see the Pro Tip at the bottom: https://gist.github.com/search – mike May 29 '18 at 21:25
  • @ccpizza's URL pattern doesn't seem to work. Gives me a file not found error.If I leave off the terminal `+%s` and change the % code after `user` to `%3A`. it searches. Seems broken at the moment though, as I'm not getting any results. – mpag Apr 22 '19 at 18:04
  • @mpag: I guess it was messed by escaping; assuming your github user is `mpag` the following will search for `needle` within your gists: `https://gist.github.com/search?utf8=&q=user:mpag+needle`. The `%s` is a *placeholder* for google chrome, and is replaced by chrome with whatever you type after the keyword. see also https://www.makeuseof.com/tag/create-custom-search-engines-google-chrome/. Once configured you can type `gist needle` in the chrome address bar and get the results. – ccpizza Apr 22 '19 at 18:15
  • @ccpizza: using Firefox rather than Chrome was likely why the +%s didn't work for me then. I got a user-based search to work, provided in my case I additionally used the `fork:true` keyphrase. But I can't seem to get a comment-search to work. See https://stackoverflow.com/questions/55799550/search-gist-comments. Thanks for the response to an 8-year old thread within 10 minutes:) – mpag Apr 22 '19 at 18:56
  • @mpag: for firefox I don't even see an option to edit the custom search engine URL template, only the option to set the keyword. – ccpizza Apr 22 '19 at 19:03
  • It should work in Firefox too. "Custom search engine URL template" is stored in the Location field (the field with URL). As for the answer itself, searching by user makes it more usable, by a lot. But the hash (#) character doesn't seem to add any value. The search results are the same whether you use # or not. – x-yuri Jan 23 '21 at 09:48
31

Checkout the cross-platform (Linux/macOS/Windows) gist manager Lepton. It's free and licensed under MIT. http://hackjutsu.com/Lepton/

enter image description here

It seems it meet your needs if you are working in a desktop/laptop environment. (No iOS/Android support yet). Here is the feature list:

  • Group your gists by languages
  • Create/Edit/Delete gists
  • Instant search
  • Custom tags (#tag1, #tag2)
  • Markdown rendering
  • Cross-platform support
  • Proxy

Disclaimer: I'm the major contributor to Lepton.

hackjutsu
  • 8,336
  • 13
  • 47
  • 87
19

Gists are lightweight repositories, so why not take advantage of that?

Clone your gists to a 'my_gists' directory, organized in the way you would want them organized.

Then they become searchable fully using whatever search tools you are familiar with on your operating system.

You also have the advantage of being able to edit, comment, commit and push.

This let's you do all that you have listed and more.

Add git instaweb to the mix and you even have a rudimentary web interface to your gists.

vgoff
  • 10,980
  • 3
  • 38
  • 56
16

My colleague and I are working on an open source cross-platform project to manage gists. It's in a beta stage - gistoapp.com.

enter image description here

It current feature list:

  • Advanced search
  • Enterprise log-in
  • Tags
  • Syntax highlight
  • Grouping by language
  • Quick snippet actions
  • Copy to clipboard
  • Copy file contents to clipboard
  • Editor settings
  • Theme color changer
  • Drag and drop to create files
  • Markdown preview (with emoji)
  • AsciiDoc preview
  • Comments
  • Web app

Full source, and downloads are available via github.

sanusart
  • 1,527
  • 1
  • 11
  • 12
6

It might be possible to clone your gists into a local folder (as pointed out by vgoff), then build some sort of personal website around this hosted on github pages... Using Jekyll/liquid you could tag and have categories... Embed using JavaScript, or use partials to inject code into the source ( using pygments to handle the syntax highlighting - or do it client side e.g using SyntaxHighlighter ). Perhaps use google search for the search component... or dynamically build up a json file, or use github's gist API ( http://develop.github.com/p/gist.html ) to pull in json for meta data and public repos...

You could possibly take this further and "demo" your HTML/CSS/JS gists using jsFiddle.net (you can create a new fiddle from a gist... See: http://doc.jsfiddle.net/use/gist_read.html )

I'm going to need a system like this for a project I'm working on ( http://getfiremonkey.com ) - it's for teaching teenagers HTML/CSS/JS in Firefox... And I'm thinking of building it on top of Github Pages/Gist/jsFiddle.net ... Free, open, interactive examples and branchable.

I've decided to setup a side project to focus on building a Gist CMS from anything I learn along the way...

https://github.com/chrisjacob/gist-cms

"Personal Gist CMS hosted on Github Pages. A code / content management system powered by Jekyll to tag, categorize and search your Gist archive. Keep all your Gist's organized in one repository; and show them off the the world with their own dedicated website."

Right now it's just an idea; so let me know if you're interested - and lend a hand if you can ^_^

Chris Jacob
  • 11,878
  • 7
  • 47
  • 42
5

I use Sublime Text, and the Gist plugin is very handy. It can easily insert, upload, etc. from within the text editor.

While applications such as Gistbox look pretty, I would prefer a lightweight and fast solution. If you use Sublime Text you may want to give it a try.

https://github.com/condemil/Gist
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
kevin
  • 1,107
  • 1
  • 13
  • 17
1

I've found Snip2Code to be a useful service that lets you manage your own code snippets, giving you the capability to share with colleagues and edit/tag them in a powerful way

Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
0

Here's another clear and simple gists organizer - Gist List: https://gistlist.nfshost.com

Its purpose is precisely to help to manage a gists collection.

With it, you can:

  • sort and search your gists,
  • add colored tags to them,
  • backup all your gists to zip file.

What you can't do is editing and copying, it just links to GitHub functionality.

ksdev
  • 3
  • 1
0

You can also try Snipit: https://snipit.xyz - it helps you easily save and organize your code snippets. It's still in beta, but it allows you to:

  • snip code blocks directly from the pages you visit, with a handy browser extensions;
  • organize your snippets in lists;
  • search snippets by list, title, syntax and tags.

Features from upcoming version:

  • collections: group multiple lists in packages or libraries (e.g. "Bootstrap code examples", or "PHP functions");
  • sharing and collaboration: share snippets with everybody, or only with specific people; collaborate with team members;
  • companion desktop app and IDE extensions: quickly find snippets while you're working, without breaking your development flow;
  • last but not least: integration with Gist.

Give it a try and hope it solves all your needs.

Andrei Duca
  • 372
  • 2
  • 11
0

If your snippets are Ruby snippets, I'd suggest boson. I use it to maintain my repository of 450+ ruby commands (snippets). I search my commands by name, description, usage, alias and other fields as well as sort by them.

Since my commands reside in local files, I can easily export to gists or install gists as boson commands. I can do all of the things you want to do except list by date and tag. Listing by date is trivial (timestamp of the file) and tags is something I'd like to add to boson as a plugin one day.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
cldwalker
  • 6,155
  • 2
  • 27
  • 19