← blog

MyBB MyCode for Enabling GitHub Gists in Posts

GitHub gists are a way to easily share your code snippets without hassles of worrying about embedding Syntax Highlighting options. Moreover, they too are git repositories, so they are automatically versioned, forkable and usable as a git repository, which allows a step up in open source and social coding.

Admin Panel TODO

  • Go to Configuration > MyCode in Admin Panel.

  • Add a new MyCode.

  • Name and short description of your choice, the Regular expression for this would be, [gist](.*?)[/gist] and the replacement HTML would be src=“https://gist.github.com/$1.js”>

  • Save your MyCode and you are done on the admin side.

Usage

For using this thingy, just open a new thread or a reply. Type in

[gist]3197075[/gist]

The 3197075 should be replaced by your github:gist ID, which you will find at the end of your gist url. (e.g. gist.github.com/3197075)