Skip to content

Instantly share code, notes, and snippets.

View simevidas's full-sized avatar
🦊
sticking with Firefox till the end

Šime Vidas simevidas

🦊
sticking with Firefox till the end
View GitHub Profile
if (!HTMLVideoElement.prototype.canPlayType) {
HTMLVideoElement.prototype.canPlayType = function(type) {
return [
"It is certain",
"It is decidedly so",
"Without a doubt",
"Yes definitely",
"You may rely on it",
"As I see it, yes",
"Most likely",
@rwaldron
rwaldron / exponentiation.md
Last active August 29, 2015 14:01
Exponentiation Operator: **

Exponentiation Operator

Performs exponential calculation on operands. Same algorithm as Math.pow(x, y)

  • Commonly used in albegra, geometry, physics and robotics.
  • Nice to have "inline" operator

Prior Art

  • Python

@simevidas: @seanmonstar I've come up with some questions: https://t.co/rlG2ZHLOXO (Context: https://t.co/5UBSoYmcKv)

Is it possible to use an email address from your own domain for Persona? (E.g. if John Smith owns the domain smith.com and creates the email address john@smith.com, can he use that address for Persona?) If yes, how to set it up? Which config is required on your web/email server?

Yep. If John does nothing, then he can use john@smith.com with Persona by verifying an email from Persona, and creating a password in the dialog. If John wants to own his login experience, he can set up his domain to be an Identity Provider: https://developer.mozilla.org/en-US/Persona/Identity_Provider_Overview

How does Persona remember your e-mail address? Where is that stored? (E.g. when I click “login with email” and the Persona popup has my gmail address pre-selected - How does Persona know this information? Is it kept on Persona’s server or in my browser somewhere?)

The relationship of which email you

Before I watched this, if someone would have asked about why Pointer Events wasn't getting into Chrome, I'd have pointed at Safari. I don't love that reason, but it makes sense with their current dominance on mobile. However, I don't necessarily agree, I think if every other browser implemented them, they'd come around. That's tended to be true on the web for the last 20 years (Old IEs, webgl, innerHTML, video codecs when hardware is present, etc)

As far as the main issues brought up here, which I hopefully have fairly summarized (in one sentence each, lol, sry) below, I don't see them as entirely compelling for dropping PE altogether, especially since so many real-world folks (jQuery, Dojo, IE-y people) like the unification quite a bit.

  1. Hit tests (with or without capture) are expensive and bad for performance

From what I can read from the previous calls and conversations[0] about this, it's less of an issue than it seems. From those conversations, it seemed like hit tests weren't cached, and Chrome at

@WebReflection
WebReflection / Object.getOwnPropertyDescriptors.js
Created March 3, 2014 01:39
A plural ES5 + ES6 friendly version of Object.getOwnPropertyDescriptor
'getOwnPropertyDescriptors' in Object || (
Object.getOwnPropertyDescriptors = function (Object) {
var
gOPD = Object.getOwnPropertyDescriptor,
gOPN = Object.getOwnPropertyNames,
gOPS = Object.getOwnPropertySymbols,
gNS = gOPS ? function (object) {
return gOPN(object).concat(gOPS(object));
} :
gOPN,
@zachleat
zachleat / font-sizes.js
Last active January 11, 2019 09:47
Returns a unique sorted array of font-size values on a page.
(function() {
let fontSizes = new Set();
document.querySelectorAll("*").forEach(function(node) {
fontSizes.add(window.getComputedStyle(node).getPropertyValue("font-size"));
});
return Array.from(fontSizes).sort();
})();
@nolanlawson
nolanlawson / wishlist.md
Last active May 3, 2021 11:51
Safari IndexedDB/WebSQL bug wishlist

Safari IndexedDB/WebSQL bug wishlist

Big overview of what's missing in Safari 7.1+ and iOS 8+ in terms of browser storage.

Updated May 25th 2016

Safari (general)

@scottjehl
scottjehl / getViewportSize.js
Created March 16, 2012 19:25
Reliably get viewport dimensions in JS
/*!
An experiment in getting accurate visible viewport dimensions across devices
(c) 2012 Scott Jehl.
MIT/GPLv2 Licence
*/
function viewportSize(){
var test = document.createElement( "div" );
test.style.cssText = "position: fixed;top: 0;left: 0;bottom: 0;right: 0;";
/*!
* jQuery JavaScript Library v2.1.1pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
@hdragomir
hdragomir / sm-annotated.html
Last active March 5, 2024 08:57
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);