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
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" | |
] | |
} |
Yeah cool, ... wait ... no. :contains('')
is not a valid QSA selector and relies on Sizzle. Therefor its faster. You out of all JavaScripties should know best ;)
I could stick with the $ though ... and put unsafeWIndow.
in front of it, while I am a it.
I wasn’t talking about speed – just trying to save bytes. Isn’t that what @140bytes is all about? :)
As long as it is below 140bytes I should be ok. If this was a valid entry anyways.
How about not using jQuery (relying on other libraries is not very 140byt.ish):
(function(i,l){i=document.getElementsByTagName('li');l=i.length;while(l--){i[l].style.display=/140byt\.es -- Click/.test(i[l].innerHTML)?'none':''}})()
GitHub uses jQuery, so I get it for free.
If this is limited to github using jQuery, you could use "$" instead of jQuery, too.
As long as it is below 140bytes I should be ok. If this was a valid entry anyways.
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”).
Couldn’t this be shortened into
$("span.description:contains('140byt.es -- Click')").closest("li").hide()
? ;)