Skip to content

Instantly share code, notes, and snippets.

@tryvin
Created November 1, 2015 14:52
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tryvin/74c72bdae96f21e844a0 to your computer and use it in GitHub Desktop.
Save tryvin/74c72bdae96f21e844a0 to your computer and use it in GitHub Desktop.
Tumblr gist insert
<script src="http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js"></script>
<script type="text/javascript">
$(function() {
$("a[href]").each(
function(index, element) {
if ( $(element).attr('href').indexOf('gist.github.com') > 0 ) {
var divElement = $('<div></div>');
$(element).after(divElement);
writeCapture.html(divElement, '<script src="'+$(element).attr('href')+'.js"></'+'script>');
$(element).remove();
}
}
);
});
</script>