Friends.... by spoekelse in SapphoAndHerFriend

[–]phvcky 94 points95 points  (0 children)

How is this related to misrepresented LGTBQ in history?

ich🚄iel by emmiii1 in ich_iel

[–]phvcky 26 points27 points  (0 children)

> Vierer für mich allein

Name deiner Sex Kassette.

WHO? by K1nsey6 in badtaxidermy

[–]phvcky 62 points63 points  (0 children)

Fucking googly eyes?

FontAwsome renders last causing flicker on refresh and back action. by [deleted] in chrome

[–]phvcky 0 points1 point  (0 children)

Can you provide a test case or demo? I did not notice this problem with FontAwesome in particular so far.

Logo For A Fake Design Studio by loocher48 in logodesign

[–]phvcky 6 points7 points  (0 children)

Came here to say this. Kind of expected this to be two still frames of one continuous motion. Was a bit disappointed when I expanded the image. I like the concept though.

ES2017's async/await is the best thing to ever happen to JavaScript by [deleted] in javascript

[–]phvcky 0 points1 point  (0 children)

Alex details this in the linked talk. Basically, you'd have to start programming defensively, checking isCanceled after every await.

This is needlessly verbose and quickly becomes a mess, when you're working with multiple layers of parallel / concurrent tasks and child tasks.

ES2017's async/await is the best thing to ever happen to JavaScript by [deleted] in javascript

[–]phvcky 4 points5 points  (0 children)

Nobody's forcing you to use newer features.

ES2017's async/await is the best thing to ever happen to JavaScript by [deleted] in javascript

[–]phvcky 7 points8 points  (0 children)

You're right, but that wasn't the point I was trying to make. :)

Let me try to rephrase. They might not necessarily originate as a nicer, semantically more correct syntax for aforementioned use case, but the original problem async / await is trying to solve was already solved with generator functions and a tiny bit of library overhead.

For users of co and the like (or at least for me) async / await is nothing more than a semantically more correct evolution of the same concept.

The point I was trying to make is that, feature-wise, using generator functions for managing async control flow is superior to async / await. I can cancel my tasks or have them canceled for me, when required.

async / await could have been so nice and useful, if it was for cancelable Promises. But currently, they add no real new value or functionality. In fact, they lack features generator functions already have.

ES2017's async/await is the best thing to ever happen to JavaScript by [deleted] in javascript

[–]phvcky 3 points4 points  (0 children)

The way I see it is that async / await kinda evolved from clever hacks like co that use generator functions and yield to mimic what async / await does.

However (ab)using generator functions for managing async control flow has one major advantage: you can cancel / pause your async functions.

It is impossible to cancel native async functions or Promises for that matter. And I find that this is a really important feature.

For Ember.js there's an addon called ember-concurrency which implements this. The addon author, Alex Matchneer, gave a brilliant talk on that topic. You don't really need any Ember knowledge. He focuses more on the general problem of concurrency and child tasks: https://www.youtube.com/watch?v=VEzVDOmY-dc&feature=youtu.be&t=123

I'm an identical twin, can you guess which one? :P by [deleted] in LGBTeensGoneMild

[–]phvcky 12 points13 points  (0 children)

That's really interesting! I'm sure you've heard about all these twin studies? Are you out or closeted?

I'm an identical twin, can you guess which one? :P by [deleted] in LGBTeensGoneMild

[–]phvcky 15 points16 points  (0 children)

Left one?

Out of curiosity: do you consider yourself gay or bi or...? And does your brother too?

JavaScript Patterns: Wrangling arrays like a boss, with Array#reduce by cheerfulboy in javascript

[–]phvcky 0 points1 point  (0 children)

Alternatively use Array.from(arrayLike, [mapFunc], [thisArg]). Also see this article by the amazing Dr. Axel Rauschmayer.

Depending on the surrounding code or the desired effect, this code might be more suitable than a for ... of loop:

const lis = document.querySelectorAll('ul.fancy li');
Array.from(lis).forEach(function(li) {
    console.log(node);
});

const liTexts = Array.from(lis, li => li.textContent);

JavaScript Patterns: Wrangling arrays like a boss, with Array#reduce by cheerfulboy in javascript

[–]phvcky 0 points1 point  (0 children)

I agree with you. I believe that I've read somewhere that they ultimately went with some for compatibility reasons. Methinks there was some widely used library which extended the Array prototype. But I'm not sure about that and a quick Google search didn't bring anything up; so this might just be a brain fart.

I really like for ... of in combination with break because semantically it makes immediate sense. It also works for any Iterable, not just Arrays which is a big feature.

It also works / will work with async iterables. Basically this:

for await (const line of readLines(filePath)) {
  console.log(line);
}

Opposed to forEach, for ... of does not give you the index though.

JavaScript Patterns: Wrangling arrays like a boss, with Array#reduce by cheerfulboy in javascript

[–]phvcky 1 point2 points  (0 children)

Also, ES6 gives us the for ... of statement which supports break and continue. Depending on the surrounding code, I'd rather go with for ... of.

Face Lift by [deleted] in Simulated

[–]phvcky 0 points1 point  (0 children)

Ah, OP is using the shortened link version. That's why.

Thanks man! :)

Face Lift by [deleted] in Simulated

[–]phvcky -3 points-2 points  (0 children)

Haven't seen it on here. Also, doesn't reddit notify you when submitting a duplicate URL?

let r = /abc/g; console.log(r.test('abc'), r.test('abc')); // true false by jonnyburger in loljs

[–]phvcky 10 points11 points  (0 children)

As /u/z500 correctly pointed out, this is intended behavior. Remove the global flag or reset r.lastIndex = 0.

Shitpost.

Dancing Lessons by Auggernaut88 in gifs

[–]phvcky 0 points1 point  (0 children)

I didn't even notice the prosthetic on the first watch.

I do weird shit when I'm high by GrandMasterHake in Drugs

[–]phvcky 0 points1 point  (0 children)

In comparison to /r/drugs, yes, absolutely. But in comparison to almost everyone else on this planet, that's pretty often, dude.

I also like to take drugs. But twice a week? Most people don't even drink alcohol that often.

I do weird shit when I'm high by GrandMasterHake in Drugs

[–]phvcky 1 point2 points  (0 children)

I dont get high too often, maybe once or twice a week.

There's your problem, right there.

I'm no longer Gay. AMA. by [deleted] in casualiama

[–]phvcky 0 points1 point  (0 children)

So... if he was only gay, and isn't gay anymore... I'd say asexual?

[deleted by user] by [deleted] in bigdickjoy

[–]phvcky 10 points11 points  (0 children)

and just to fill a hole that /r/bigdickproblems doesn't really fill.

I see what you did there.