Search

Tuesday 7 June 2016

How to embed code snippets or files from github

Gist can help you embed code from Github into any of your posts.

How to use Gist to embed code from Github:

  1. Go to Github. Login into your account.
  2. Go to Gist.
  3. Put your code into the box (copy and paste). You can optionally add Gist Description, the language you are using and the Gist name as well.
  4. Click on create Public Gist at the bottom.
  5. On the next page you will get the code for embedding the Gist that you just created. Copy it and paste it where ever you want to use this Gist.


Example gist: