Skip to content

Instantly share code, notes, and snippets.

@dustym
Created July 28, 2008 22:03
Show Gist options
  • Save dustym/2962 to your computer and use it in GitHub Desktop.
Save dustym/2962 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Fix tabs in gist paste.
// @namespace Gist
// @description nukes tabs
// @include http://gist.github.com/
// ==/UserScript==
var jQuery = unsafeWindow.jQuery;
$ = jQuery
$('.paste').prepend('<a href="#" id="fix_the_fucking_tabs">fix the fucking tabs</a>');
$('#fix_the_fucking_tabs').click(function() {
$("textarea[name^=file_contents]").each(function(i) {
$(this).val($(this).val().replace(/\t/g,' '));
});
return false;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment