Skip to content

Instantly share code, notes, and snippets.

View marcelweder's full-sized avatar

Marcel A. Weder marcelweder

View GitHub Profile
@marcelweder
marcelweder / load-css-js.js
Last active June 15, 2016 13:24
Load a CSS files asynchronously
/*! loadCSS: load a CSS file asynchronously. [c]2016 @scottjehl, Filament Group, Inc. Licensed MIT */
!function(e) {
"use strict";
var t = function(t, n, i) {
var o, a = e.document,
d = a.createElement("link"),
r = i || "all";
if (n) {
@marcelweder
marcelweder / countcssrules.js
Last active June 15, 2016 13:23
Count all CSS-Rules in WebClient
// See also: http://stackoverflow.com/questions/9906794/internet-explorers-css-rules-limits
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}