snippets – Parerga und Paralipomena http://www.michelepasin.org/blog At the core of all well-founded belief lies belief that is unfounded - Wittgenstein Sat, 24 Dec 2016 18:17:33 +0000 en-US hourly 1 https://wordpress.org/?v=5.2.11 13825966 How to copy snippets from Github Gists to Dash http://www.michelepasin.org/blog/2016/12/24/extracting-snippets-from-github-gists-to-dash/ Sat, 24 Dec 2016 18:15:37 +0000 http://www.michelepasin.org/blog/?p=2810 If you’re a Dash for MacOS user, here’s a little script to copy existing code snippets saved as Github Gists into the Dash snippets database.

Dash for MacOS is an application that allows to keep a local library of a multitude of programming frameworks and libraries, so that you can search this library quickly using an offline intuitive interface.

Dash

Dash has a feature for creating and managing code snippets – there are many other alternatives out there for this – but probably the fact you can store snippets alongside other documentation could be a winner in this case.

Anyhow, since I’ve been collecting lots of snippets as Github Gists, I thought I’d be nice to load them up into Dash so to test it out a bit more!

Note:

– the solution below does not extract tags information at the moment

– always a good idea to make a backup copy of the Dash database before messing with it. Then just update the value of the DASH_DATABASE parameter in the script and start the extraction.

– inspired by another gist: https://raw.github.com/gist/5466075/gist-backup.py

 

So here we go:

 

]]>
2810