Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SantoshSrinivas79/77697ca005f4c5b2c801 to your computer and use it in GitHub Desktop.
Save SantoshSrinivas79/77697ca005f4c5b2c801 to your computer and use it in GitHub Desktop.
Using Github Gists as an internet file system

Using Github Gists as an internet file system

Sublime Text has now become my favorite environment of choice for coding, blogging and practically everything else.

The editor is hackable and the plugin support makes it really useful to both increase productivity and customize the blogging to my idiosyncracises!

So lets cover first why this!?

Functionality

  • Files in the cloud!
  • Bloggable change log and modifications can be made on the fly
  • Love SubLime
  • Spell Check functionality
  • Markdown Functionality
  • Leverage the speed of GitHub! (Stand on the shoulder of giants!)
  • Cross platform compatibility
  • Ability to integrate with custom development platforms (e.g. Meteor!)

Tools and Techniques

  • Use the condemil/Gist to integrate creating and updating gists straight out of Sublime Text
  • Use bgreenlee/sublime-github as another plugin to manage gists on Github straight out of Sublime Text
  • Use the Markdown Preview plugin to view the output on the browser. The LiveReload integration is possible if you want to get real time!

Development

Here is some code to remove the unwanted items that get embedded while embeding gists

  • Remove the linked CSS file

This is useful when you want the default CMS theme to be applied to the rendered markdown! Like in this instance!

$("div.gist").siblings("link").remove()
  • Remove the gist meta information
$("div.gist-meta").remove()
  • Remove the heading from the rendered markdown

This is particularly relevant when you already have a title in the CMS post when it is created.

$("div.gist .gist-data h1").remove()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment