Skip to content

Instantly share code, notes, and snippets.

@jasondavies
Created October 9, 2010 09:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondavies/618065 to your computer and use it in GitHub Desktop.
Save jasondavies/618065 to your computer and use it in GitHub Desktop.
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.4.2",function($,L){var gist_re=/^https?\:\/\/gist\.github\.com\/(\d*)/i,rel_re=/^\/?(\d+)$/,on_gist=gist_re.test(location.href);$("a").each(function(){var b=$(this).attr("href")||'',a=b.match(gist_re);if(on_gist&&!(a&&a[1])){a=b.match(rel_re)}if(a&&a[1]){$(this).after(' <a href="http://bl.ocks.org/'+a[1]+'">[bl.ocks.org]</a>')}});});
Drag this link to your bookmarks toolbar and click it to append '[bl.ocks.org]' to any gist links on the current page: <a href="javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g&gt;f.fn.jquery||h(f)){c=a.createElement(&quot;script&quot;);c.type=&quot;text/javascript&quot;;c.src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/&quot;+g+&quot;/jquery.min.js&quot;;c.onload=c.onreadystatechange=function(){if(!b&amp;&amp;(!(d=this.readyState)||d==&quot;loaded&quot;||d==&quot;complete&quot;)){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,&quot;1.4.2&quot;,function($,L){var gist_re=/^https?\:\/\/gist\.github\.com\/(\d*)/i,rel_re=/^\/?(\d+)$/,on_gist=gist_re.test(location.href);$(&quot;a&quot;).each(function(){var b=$(this).attr(&quot;href&quot;)||&#39;&#39;,a=b.match(gist_re);if(on_gist&amp;&amp;!(a&amp;&amp;a[1])){a=b.match(rel_re)}if(a&amp;&amp;a[1]){$(this).after(&#39; &lt;a href=&quot;http://bl.ocks.org/&#39;+a[1]+&#39;&quot;&gt;[bl.ocks.org]&lt;/a&gt;&#39;)}});});">[bl.ocks.org]</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment