I have found github gists a great way to share little snippets of code online, and I found a way to add them to my blogposts , here it is.
Choose HTML mode while blogging and add the following
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script>
<div class="gistLoad" data-id="GistID" id="gist-GistID">Loading ....</div>
Replace GistID with your gist id, and there you go.
Thanks to this awesome project on github https://github.com/moski/gist-Blogger