Skip to content

Instantly share code, notes, and snippets.

View guilhermechapiewski's full-sized avatar

Guilherme Chapiewski guilhermechapiewski

View GitHub Profile
@guilhermechapiewski
guilhermechapiewski / github_wiki_toc.js
Created April 26, 2010 15:28 — forked from tekkub/github_wiki_toc.js
Create a "Table of Contents" in your Github wiki
$(function () {
var toc = $("<ul>").css("margin-bottom", "20px !important");
$("div.main div.wikistyle h2").each(function() {
var id = $(this).text().replace(/\s+/g, "_").replace(/[^0-9a-zA-Z_.-]/g, "")
$(this).attr("id", id)
toc.append(
$("<li>").append($("<b>").append($("<a>").attr("href", "#" + id).text($(this).text())))
)
});
$("div.wikistyle").prepend(toc).prepend($("<h2>").text("Table of Contents"));
@guilhermechapiewski
guilhermechapiewski / gist:91290
Created April 7, 2009 15:30 — forked from sr/gist:91275
Integrity auto-refresher
#!/usr/bin/env ruby
require "rubygems"
require "integrity"
class Refresher
JS = <<-EOS
<script type="text/javascript">
//<![CDATA[
setTimeout('location.reload()', %s * 1000)
//]]>