Skip to content

Instantly share code, notes, and snippets.

@scrooloose
Created June 27, 2010 08:59
Show Gist options
  • Select an option

  • Save scrooloose/454771 to your computer and use it in GitHub Desktop.

Select an option

Save scrooloose/454771 to your computer and use it in GitHub Desktop.
A hack to add line numbers to gists, requires jquery
function addLineNumbersToAllGists() {
$('.gist').each( function() {
_addLineNumbersToGist('#' + $(this).attr('id'));
});
}
function addLineNumbersToGist(id) {
_addLineNumbersToGist('#gist-' + id);
}
function _addLineNumbersToGist(css_selector) {
$(document).ready( function() {
$(css_selector + ' .line').each(function(i, e) {
$(this).prepend(
$('<div/>').css({
'float' : 'left',
'width': '30px',
'font-weight' : 'bold',
'color': '#808080'
}).text(++i)
);
});
});
}
@scrooloose

Copy link
Copy Markdown
Author

ah, thanks :) that article is hilarious, ie6 requires an "a" for gray, but also requires an "e" for lightgrey! wtf?! ultimate fail!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment