Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Improve your {spoiler /prog/} experience

Name: Anonymous 2012-05-26 21:50

// ==UserScript==
// @name           /prog/ cleaner
// @description    Fixes some common annoyances.
// @namespace      http://dis.4chan.org/prog/
// @include        http://dis.4chan.org/*;
// @version        1.0
// ==/UserScript==

(function() {
    var posts = document.getElementsByClassName('post');
    for (var i = posts.length - 1; i >= 0; --i) {
        var author = posts[i].getElementsByTagName('span')[3];
        var trip = posts[i].getElementsByTagName('span')[4];
        var body = posts[i].getElementsByTagName('blockquote')[0];

        if (posts[i].getElementsByTagName('code').length == 0 &&
             !author.innerHTML.match(/mailto:sage/) ||
            trip.textContent == '!MhMRSATORI!FBeUS42x4uM+kgp')
            posts[i].parentNode.removeChild(posts[i]);
    }
})();

Name: Anonymous 2012-05-26 22:10

>>1

is there any reason for the loop going backwards?

Name: Anonymous 2012-05-26 22:13

>>2
Deleting elements from a list you're looping through is bad times if you're going forwards.

Name: Anonymous 2012-05-26 22:21

>>3
huh, that seems peculiar.

Name: Anonymous 2012-05-27 12:01

At first I was getting T by that if statement but then I saw the ! was there. But still, there are plenty of non sage non code tagged posts that are relevant so you will be excluding some pivotal /prog/ experience there.

Name: Anonymous 2012-05-27 13:03

>>3
you can just forego a increment statement in the for part and just either stay at the same index or increase inside the actual loop

Name: Anonymous 2012-05-27 16:03

>>6
Right, and then you have to recalculate the length for every pass through the loop. Or you can just go backwards and not have the clutter or the additional overhead.

Name: Anonymous 2012-05-27 17:45

>>5
I'm not at all convinced that's true.

Name: Anonymous 2012-05-27 22:02

>>8
Well then maybe you should return to r/pr.

Name: Anonymous 2012-05-27 23:24

>>1
Why do you filter the cudder?

Name: Anonymous 2012-05-28 3:57

>>1
(
Lisp
stopped reading there

Name: Anonymous 2012-05-28 4:37

>>11
Well shit, son, I think you're retarded.

Name: !MhMRSATORI!FBeUS42x4uM+kgp 2012-05-28 5:00

test

Name: Anonymous 2012-05-28 5:06

>>1
why not tidy jq

$('#a').each(function a(){
    if( $(this).attr('href') == 'mailto:sage'){
        $(this).parent().parent().remove();
    }
});

$('.postertrip').each(function a(){
    if( $(this).text() == '!MhMRSATORI!FBeUS42x4uM+kgp'){
        $(this).parent().parent().remove();
    }
});

Name: Anonymous 2012-05-28 5:22

>>14
or better yet,remove everyone using a non-anon name

$('.postertrip').each(function a(){
    if( $(this).text() != 'Anonymous'){
        $(this).parent().parent().remove();
    }
});

Name: Anonymous 2012-05-28 5:33

>>13
name != trip, you cocknanny

Name: Anonymous 2012-05-28 5:47

>>16
i was testing the filters
i think the word test pretty match implies it
you fuckin' curry-nigger

Name: Anonymous 2012-05-28 5:55

Some typical ZUN patches
~~~~~~~~~~~~~~~~~~~~~~~~
Trumpet: Mariachi or Romantic Trumpet low-passed around 4000Hz with resonance. Can be combined with a reverb'd Saw Lead in order to get a softer (Fairy Wars) or a more powerful (some Imperishable Night tracks) sound. Before Imperishable Night, another, simpler, trumpet was used.
Reed: Roland Edirol Reed Romance. Mainly used in MoF and UFO.
Bass: Hard-panned Jazz Guitar or Finger Bass layered with a Picked Bass in the opposite direction. Mainly used after Imperishable Night.
Distorted Guitar: Appears to be from Steinberg Virtual Guitarist 2. Phaser effect. More research needed. Used mainly through Imperishable Night, in Magus Night and in Speed Fox.
“Phantom” Piano: XV Steel Guitar gently panned on one side and layered on a quiet Piano. Used at the beginning and the end of Phantom Ensemble and Border of Life.

Name: Anonymous 2012-05-28 6:17

>>15
Take your Cult of Anonymous back to the imageboards, where it came from.

Name: Anonymous 2012-05-28 10:14

>>17
More evidence that the only people whining about Indians are the ones that are breathtakingly incompetent themselves. Why did you have to post a test post just to make sense of a few lines of very basic Javascript?

Name: Anonymous 2012-05-28 10:30

>>20
cause I didn't want to 'make sense' of it, I wanted to TEST it.

test definition
1. A procedure for critical evaluation; a means of determining the presence, quality, or truth of something; a trial: a test of one's eyesight; subjecting a hypothesis to a test; a test of an athlete's endurance.
2. A series of questions, problems, or physical responses designed to determine knowledge, intelligence, or ability.
3. A basis for evaluation or judgment: "A test of democratic government is how Congress and the president work together" (Haynes Johnson).
4. Chemistry
a. A physical or chemical change by which a substance may be detected or its properties ascertained.
b. A reagent used to cause or promote such a change.
c. A positive result obtained.
5. A cupel.
6. A way to get on some nigger's nerves

Name: Anonymous 2012-05-28 10:32

>>19
Hello there Anonymous

Name: CaptainInsanE !!X5Zs2Y3d/1erLHZ 2012-05-28 10:47

>>20
Hey anon, don't get into arguments with these assholes they are just trolling like assholes they are, oh and please would you mind using a trip or name, so we can identify each others posts?

Name: Anonymous 2012-05-28 11:10

>>10
I'm going to guess it's for the same reason people used to filter FrozenVoid: because he's a moron who has never contributed anything of value.
In fact, I'd say he's worse than FrozenVoid. At least even complete freshmen could see FrozenVoid was full of shit; Cudder looks just plausible enough that some idiots are buying his bullshit, creating more of it.

Name: Anonymous 2012-05-28 12:39

>>22-23
You two think you're clever, but you're not. There is a middle ground between Reddit and /b/. Use identities when they add to the conversation, don't when they don't.

Name: Anonymous 2012-05-28 12:52

>>25
I couldn't agree more with you, but what do all these have to do with

/prog/


Oh and please use a trip, you're ruining my /prog/ experience

Name: Anonymous 2012-05-28 14:49

>>20
|very basic Javascript?
I hope by that by very basic Javascript, you are not to >>1
 bloated code

function TK2getImageHTML(size, zoom, sensor, markers) {
    var strFinalImage = "";
    var strHTMLStart = '<img src="';
    var strHTMLEnd = '" alt="The map"/>';   
    var strURL = "http://maps.google.com/maps/api/staticmap?center=";
    var strSize = '&size='+ size;
    var strZoom = '&zoom='+ zoom;
    var strSensor = '&sensor='+ sensor;   
 
    strURL += markers[0].latitude;
    strURL += ",";
    strURL += markers[0].longitude;
    strURL += strSize;
    strURL += strZoom;
    strURL += strSensor;
 
    for (var i = 0; i < markers.length; i++) {
        strURL += markers[i].addMarker();
    }
 
    strFinalImage = strHTMLStart + strURL + strHTMLEnd;
    return strFinalImage;

Name: Anonymous 2012-05-28 16:37

Needs moar enterprise jQuery

Name: bampu pantsu 2012-05-29 5:11

bampu pantsu

Don't change these.
Name: Email:
Entire Thread Thread List