This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loop = (() => { | |
const recur = (callback, count, i=0) => { | |
if (i == count-1) return callback(i); | |
callback(i); | |
return recur(callback, count, i+1); | |
}; | |
return (callback, count) => { | |
if (count > 0) return recur(callback, count); | |
}; | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// 1. Extract critical path CSS (see: http://addyosmani.com/blog/tag/critical-path-css) | |
// 2. Inline extracted styles within <head> | |
// 2. Place loader IIFE within <script> tags at end of <body> | |
(function(b,f){var c=[ | |
"styles/style1.css", | |
"styles/style2.css" | |
],a=function(){for(var g=0;g<c.length;g++){var d=f.createElement("link");d.rel="stylesheet"; | |
d.href=c[g];var j=f.getElementsByTagName("head")[0];j.parentNode.insertBefore(d,j)}}, |