Skip to content

Instantly share code, notes, and snippets.

@Kambfhase
Forked from 140bytes/LICENSE.txt
Created June 1, 2011 18:50
Show Gist options
  • Save Kambfhase/1002999 to your computer and use it in GitHub Desktop.
Save Kambfhase/1002999 to your computer and use it in GitHub Desktop.
Userscript that filters the forks

a minimal user script that hides forks without content. If you don't know, how to build you own user script click here to load my version.

Tested in Fx 4 + Scriptish. It does not work in Chrome.

mfG Hase

jQuery("span.description"). // selects all spanners
filter(":contains('140byt.es -- Click')"). // clicks them if they filter their contents for 140bytes.
closest("li").hide() // Hides Li in the closet.
jQuery("span.description").filter(":contains('140byt.es -- Click')").closest("li").hide()
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Kambfhase
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
{
"name": "notALibrary",
"description": "foo",
"keywords": [
"140bytes",
"gist",
"userscript"
]
}
@Kambfhase
Copy link
Author

GitHub uses jQuery, so I get it for free.

@atk
Copy link

atk commented Jun 22, 2011

If this is limited to github using jQuery, you could use "$" instead of jQuery, too.

@Kambfhase
Copy link
Author

As long as it is below 140bytes I should be ok. If this was a valid entry anyways.

@mathiasbynens
Copy link

Golfing down @atk’s suggestion for the lulz:

(function(i,l){l=i.length;while(l--){i[l].style.display=/140byt\.es -- Click/.test(i[l].innerHTML)?'none':''}})(document.getElementsByTagName('li'))

You could even shorten the regex a little bit (although that would make it slightly less “robust”).

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