Skip to content

Instantly share code, notes, and snippets.

Reading your blog posts

Šime Vidas simevidas

Reading your blog posts
Block or report user

Report or block simevidas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jakub-g /
Last active Jul 24, 2019
MacOS for Windows users: overcoming the annoyances


For a long time Windows user, starting using Mac can be an exercise in frustration and keeping your nerves at bay. Many things don't work as expected, need to be activated in some ways, keyboard shortcuts are non-existent or wildly different.

This page is a living reference of a Windows long-timer trying to do basic stuff on a Mac. If you see an easier way to achieve certain things, don't hesitate to drop a comment.

Related links:

zachleat / font-sizes.js
Last active Jan 11, 2019
Returns a unique sorted array of font-size values on a page.
View font-sizes.js
(function() {
let fontSizes = new Set();
document.querySelectorAll("*").forEach(function(node) {
return Array.from(fontSizes).sort();
nolanlawson /
Last active May 1, 2019
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)


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

hdragomir / sm-annotated.html
Last active Dec 7, 2019
The deferred font loading logic for Smashing Magazine.
View sm-annotated.html
<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);
rwaldron /
Last active Aug 29, 2015
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
WebReflection / Object.getOwnPropertyDescriptors.js
Created Mar 3, 2014
A plural ES5 + ES6 friendly version of Object.getOwnPropertyDescriptor
View Object.getOwnPropertyDescriptors.js
'getOwnPropertyDescriptors' in Object || (
Object.getOwnPropertyDescriptors = function (Object) {
gOPD = Object.getOwnPropertyDescriptor,
gOPN = Object.getOwnPropertyNames,
gOPS = Object.getOwnPropertySymbols,
gNS = gOPS ? function (object) {
return gOPN(object).concat(gOPS(object));
} :
View gist:8924778
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",
View jquery.js
* jQuery JavaScript Library v2.1.1pre
* Includes Sizzle.js
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license

@simevidas: @seanmonstar I've come up with some questions: (Context:

Is it possible to use an email address from your own domain for Persona? (E.g. if John Smith owns the domain and creates the email address, 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 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:

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

You can’t perform that action at this time.