Skip to content

Instantly share code, notes, and snippets.

@jonathantneal
jonathantneal / DOM2.js
Created October 9, 2014 04:39
DOM2 polyfill list for all browsers
// Window (Internet Explorer 6 - 7, Opera 11.6, Safari 4 - 5)
(this.Window = this.constructor = function Window() {}).prototype = this;
// Window.chrome (Chrome 14-18, Safari 5.1)
this.Window = this.constructor;
// HTMLDocument (Internet Explorer 6 - 7)
(this.HTMLDocument = this.Document = this.document.constructor = function HTMLDocument() {}).prototype = this.document;
@ericelliott
ericelliott / nstime.js
Created May 14, 2016 09:16
Convert Node's process.hrtime() return values to nanoseconds
const nsTime = (hrtime) => hrtime[0] * 1e9 + hrtime[1];
@vieron
vieron / transitions.scss
Created July 20, 2013 18:20
Sass-mixins-for-vendor-prefixed transitions-including-properties
@function prefix($property, $prefixes: (webkit moz o ms)) {
$vendor-prefixed-properties: transform background-clip background-size;
$result: ();
@each $prefix in $prefixes {
@if index($vendor-prefixed-properties, $property) {
$property: -#{$prefix}-#{$property}
}
$result: append($result, $property);
}
@return $result;
@devote
devote / XDomainRequest.js
Created April 2, 2014 13:17
XDomainRequest polyfill for HTML4 browsers (IE7, IE6, etc.)
/*
* XDomainRequest polyfill for HTML4 browsers (IE7, IE6, etc.) v0.1.0
*
* Required: jClass 1.4.0+
*
* Copyright 2012-2014, Dmitriy Pakhtinov ( spb.piksel@gmail.com )
*
* http://spb-piksel.ru/ - https://github.com/devote
*
* Dual licensed under the MIT and GPL licenses:
@fnlctrl
fnlctrl / vue-route-data.js
Last active July 21, 2020 21:30
VueRouteData plugin for vue-router@2.0 and vue@1or2
/**
* VueRouteData plugin for vue-router@2.0 and vue@1or2,
* implemented according to https://github.com/vuejs/vue-router/issues/296#issuecomment-235481643
*
* This plugin looks for `$options.fetchRouteData`,
* and watches `$route` using `$options.fetchRouteData` as handler.
*
* Before `fetchRouteData` executes, this plugin sets 'loadingRouteData' to true,
* and when it finishes executing, the plugin sets 'loadingRouteData' to false,
* so `fetchRouteData` can either be normal functions or async functions.
@cms
cms / es3-es5-incompatibilities.js
Created October 27, 2010 18:55
List of ES3 Incompatibilities introduced by ES5
/*
* List of ES3 Incompatibilities introduced by ES5.
*
*/
/*
* From Annex E:
*/
/*
* Property prefix hacks
*/
/* IE6 only - any combination of these characters */
_ - £ ¬ ¦
/* IE6/7 only - any combination of these characters */
@gmetais
gmetais / gzip-conf.txt
Last active February 28, 2021 14:06
This is a list of Content-Type / mime-type for a server Gzip/Brotli compression configuration
This list was moved to https://letstalkaboutwebperf.com/en/gzip-brotli-server-config/
@MSEdge
MSEdge / IE-Edge-diff.idl
Last active January 29, 2022 23:18
Proprietary / Non-Inteoperable IE APIs no longer in Microsoft Edge
interface AesGcmEncryptResult {
readonly attribute ArrayBuffer ciphertext;
readonly attribute ArrayBuffer tag;
};
interface BookmarkCollection {
readonly attribute long length;
any item(unsigned long index);
input[type="text"] {
/* */
}
input[type="submit"]{
/* */
}
input[type=button]{
/* */
}