I Fixed HTML5 Video
snippet
const videos = document.getElementsByTagName('video'); Array.prototype.forEach.call(videos, video => { video.addEventListener('error', () => video.load()); });
@malectro / malectro.tumblr.com
snippet
const videos = document.getElementsByTagName('video'); Array.prototype.forEach.call(videos, video => { video.addEventListener('error', () => video.load()); });
The biggest misuse of promises in JS is when you write this:
action1().then(() => { return action2().then(() => { return action3(); }); });
when you would be writing this:
action1().then(action2).then(action3);
http://www.theatlantic.com/health/archive/2016/01/romantic-rejection-and-the-self-deprecation-trap/424842/
I'm not going to vouch for this article, but I agree with the main point. It's why I'm strongly bothered by horoscopes and Myers-Briggs types. Convincing people that they have a static nature prevents them from participating in the uniquely human ability to learn, grow, adapt, and transform.
http://mobile.nytimes.com/2015/12/06/magazine/white-debt.html
http://www.newyorker.com/magazine/2015/12/14/a-house-divided
The consequences of lies are dire.
yup
DFW gets closer than anyone to communing with our hungry ghosts.
It's a sorrowful Q&A, and one wonders, "with the rise of secular comfort, how will we choose to spend our free time? Will we just gorge ourselves until eternity?"
Some stats:
Some thoughts:
Last year, I sat down at my desk, scrolled through The Times and found a review of the latest giant robot smash'em'up, Transformers: Age of Extinction. Was this the 3rd film in the franchise? Was it the 4th? I couldn't remember – mostly because I'd only ever caught glimpses of past films on Best Buy demo TVs and had never taken the time to mentally catalogue the plot or characters. I clicked to read, partly to answer my main question, "why was this franchise a thing?", but also to revel in what I hoped to see as a skewering of a sold-out Hollywood. I got what I wanted.
Many hours later toward the end of the day, one of my coworkers turned to me to ask about my coming weekend.
"Are you seeing the movie?" he asked. Still a coworker, he's an extremely polite, smart, and eager team member that is constantly forced to translate new English words and idioms into his native Chinese. What I'm saying is that his day-to-day job is harder than mine.
"Seeing what? The Matrix?" I responded genuinely confused. There was a company movie night coming up, and all of them came with a sense of retro irony. Maybe it was that?
"Oh," he seemed confused that I didn't get it, "Transformers! Isn't The Matrix old?"
Time freezes. Words fly slowly toward me like eels swimming in jello.
I wrote the above anecdote around when it happened, and since then I’ve read a lot about the Transformers franchise and its pandering to Chinese audiences. Other thinky writers have pointed to bizarre moments of appeasement in many recent blockbusters, and as a reader of such thinky writing, it’s difficult not to see this pandering as lazy on the side of hollywood (which is impossible to refute – we can always do more work), or tasteless on the side of Chinese audiences (which is totally racist and self-elevating).
But what I instead saw in my coworker was pure earnestness. What he wanted was to escape to a world of pristine CGI, where a thin illusion of risk spurred heroes to a climactic goal, not unlike Magic Mountain’s Goliath or a few hours of narrative gaming.
And when, a couple months later, I thought I’d connect with him by bringing up Guardians of the Galaxy, we found more dissonance.
He’d found the plot confusing and the language strange. He admitted that most of the jokes didn’t make any sense to him.
In retrospect it’s not surprising that a movie involving heavy references to western 80s and sci-fi culture, helmed by a hero winking-ly calling himself “Starlord”, further lifted by the very American political, workplace comedy that wrought him, and strewn with verbal puns; wouldn’t really appeal to someone raised on dramatic Taiwanese spectacle that finds The Matrix “old”.
(Imagine trying to explain why "Starlord" is both a funny and apt name for the hero. "Well, he's obviously not the lord of any star in the movie, but it's the sort of name you'd give a comic book villain. So it makes him seem sinister. But he's obviously aware he's not sinister. He's a sensistive hero. Plus it reminds you of the sincere last name of a jedi, which is a sort of warrior monk in space.")
The simplistic fact is that Guardians of the Galaxy is a clever film targeted at a specific affluent, white generation nostalgic for a time of childish opulence and Transformers is a franchise looking for straight, broad appeal. The first is done with wit, the second with visuals.
At it’s best, wit elevates our thinking with insight into human behavior. Much as my adolescent self was introduced to the normalcy and dignity of gay through a goofy (and possibly insensitive) episode of the Simpsons, comedic content can reveal logical and moral inconsistencies without assaulting the audience. Instead of putting up a defensive, argumentative shield, the listener is in on the joke.
But so often it is complexity for the sake of elevation and differentiation, a way of separating the smart, cultured, and cool from the tasteless. It is one of the derogatory definitions of “hipsterdom”, the culture that conveniently sifts the most privileged to the top.
The problem is that it isn’t enough to sort the two. They are inexorably linked in the way the same call of “come this way!” might lead one maze runner closer to the exit and another staring at a wall. It all depends on where in the maze they are. And though it gets more difficult as more people enter the maze, there can be the opportunity to direct them all toward the goal.
(I don’t want to get too deep into the metaphor here, but needless to say “the goal” is whatever we want. For me it’d be “truth”, but all sorts of nefarious isms can foot the bill.)
So what insight does Guardians provide? Not a whole lot it turns out. One could argue that Transformers, despite its broad appeal, actually does harm (a movie about toys treating women like toys) while Guardians sits there looking elitist and benign, but following all the beats really well doesn’t make a film harmless. “The privileged, gifted white guy charming everyone and realizing he’s special” isn’t exactly new or insightful, however clever and fun the jokes are along the way.
Then compare both these films to Fury Road, a film that during a blistering and expensive 2-hour chase scene manages upend the idea of the male savior while simultaneously warming his heart. The patriarchy is the villain, but all men are cordially invited to its downfall.
Or listen to Good Vibrations, a song that sold extremely well all over the world but still manages to fill a whole wikipedia section on its Musical Structure and Style as well as its “legacy”.
In a recent interview on the show, Bullseye, Rob Corddry is asked (facetiously) what it was like to act in a Transformers movie, and he tactfully answers with a description of the work ethic of everyone involved – Michael Bay especially. I doubt there’s much more you can say about a production company that serves films with the efficiency and satiation of fast food, a production company that managed to gross over a billion dollars with its last effort. In any other industry this would be the highest praise.
But there’s a reason the comment feels a little dry. Even from our toy-to-screen adaptations, we hope for more.
I suppose my point here is that broad appeal and witty insight can be difficult to mesh – almost inversely correlated. Broad appeal in and of itself is too often seen as a red flag to the “tasteful” viewer. But in a world where economic comfort and leisure are more and more attainable to people of strikingly different cultures and moral codes; the slapstick comedies and explosive blockbusters, giddy pop songs and soulful ballads, all have the room to connect and elevate us. If only they’d try.
Animals and rocks once lived together, though unharmoniously.
Rocks, being of greater mass and stature, played the bully as the powerful are often want to do. They'd smash herds of organics like a broom sweeping up dust and would roll over frightened organisms while they traveled, unaware of the damage in their wake. You could call them heartless, and you'd be right. We were their insects.
The biggest of them bumped around the oceans in a massive waltz, forcing us to brace for impact whenever they entered a tackle, one lifting the other off the earth, all of us sliding down their backsides.
Thus, we were always on the run. To linger was to become the sole of a shoe, the pawn in a game of chess, or the ball in a sport. We were prey, and they were gods, unconcerned with our plight. It did us no good to breed – we seemed at times an unlimited resource –, but breed we did.
So it was that Ayil begged Soon a single wish, "Let my whole life be lived in an hour. For beyond that, I lack the strength for this world." Soon, laughing at her self pity and thinking the request Animalistic in its stupidity, took the time to weave in such a strain.
And when Ayil's children came, they acted as dust, dispersed and transprent within an hour. It was only when, Soon realized, Ayil finally passed away herself, that her children had multiplied. Each day, whole generations staked claim on its shoulders, easily weathering its clumsy attempts to rattle them off, and we older animals faded behind, unable to cope with such swift competition.
I've tried to conjur the world of the children for myself. Boulders suspended and stacked at the queerest angles must seem to hang like cumulus – stuck in the sky, ignoring gravity, but secretly moving. Pebbles, once eratic and frightening in their numbers, probably sit as piles of tools and toys.
But Soon's attempts at disruption, even in their rarity, surely are felt. A god is a god after all.
Aziz Ansari
This used to be proof of Kanye's egomania, but I totally get it now. Making your own music is so utterly gratifying, why wouldn't you listen to it? No one gets laughed at for eating their own cooking or hanging their own art.
In the UX world, I’m kindof an old timer. I remember when we did it all with jQuery and called it AJAX, even though AJAX has nothing to do with DOM manipulation or animations. Our dropdown menus would slideUp and slideDown like the tongues of helpful iguanas, and we’d spend hours slicing pngs to to make rounded corners in all the colors of the blueish rainbow.
Now I’m happy to write a few lines of CSS and leave JavaScript with the logic. I still use jQuery (mostly out of habit) but only invoke 10% of its methods. Things like slideUp and hide are easily accomplished with CSS analogues and with far less code.
But what about fadeIn and fadeOut, two of the most useful animations on a designer’s tool belt? I wrote it the other day, and it seemed easy enough.
.item { transition: opacity 0.2s; } .item.hide { display: none; opacity: 0; }
It's so simple. Add the hide class, and the item fades out – except it doesn't. Changing the display style of an element makes it skip any relevant transitions causing the opacity change to be immediate (and pointless). Turns out we have to do hack together a bunch of extra styles to get the desired effect, and the result isn't a good read.
.item { transition: opacity 0.2s, height 0; } .item.hide { opacity: 0; height: 0; overflow: hidden; transition: opacity 0.2s, height 0 0.2s; }
The explanation for why the rendering engine requires this is a fine one, and I won't go into it here. Others have. But I will point out how obtuse it is to make an extremely common effect, one that is easily accomplished with a single jQuery function call $('.item').fadeOut(), so difficult in a version of CSS that can otherwise recalculate measurements and even animate sprites with ease.
Why is this the only avenue in which we've crossed the median and made a U-turn? Am I missing something here?
A new song. All lyrics monosyllabic.
to scale