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
/* debounce(func,context,ms) returns a function that will be called only ms millisecond after it's latest call. | |
context and ms are optionnal. | |
*/ | |
var debounce = (function(window){ | |
var defaultMs=300; | |
return function (func,context,ms){ | |
var to; | |
return function(){ | |
var args = Array.prototype.slice.call(arguments); | |
if(!!to) clearTimeout(to); |
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
/* throttle(func,ms,context) returns a function that can't be called more than once every ms milliseconds. | |
context and ms parameters are optionnal. | |
*/ | |
var throttle = (function(window){ | |
var defaultMs=50; | |
return function (func,ms,context){ | |
var to; | |
var wait=false; | |
return function(){ | |
var args = Array.prototype.slice.call(arguments); |
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
/* | |
It isn't a full implementation : you can't use it to search named groups or anything. | |
It just returns the number of capturing parentheses of the pattern passed as the 1st argument. | |
Usage : | |
find_parens_sub(/(my pattern)/i.source); // 1 | |
Idea ? comment ? insult ? camille.hodoul [at] gmail.com or @Eartz_HC | |
I copied this function from http://www.opensource.apple.com/source/pcre/pcre-4.2/pcre/pcre_compile.c , |
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
(function() { | |
if(!!window.history) { | |
var curHash = ""; | |
var nextIndex = 0; | |
var setHash = function(str, title) { | |
curHash = str; | |
window.history.replaceState({}, title, '#'+str); | |
}; | |
var states = ["(>°.°)>","(^°o°)^","<(°.°<)","^(°o°^)"]; |
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
<!-- see it in action here : https://github.com/rollup/rollup-starter-code-splitting/blob/master/public/index.html --> | |
<!-- Browsers with dynamic import support --> | |
<script type="module"> | |
window.esDynamicImport = true; | |
// this will throw if dynamic import is not supported | |
import("/js/es/entrypoint.js").then(function(m) { | |
// do something | |
}); | |
</script> |
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
[ignore] | |
.*/node_modules/.* | |
.*/public/.* | |
.*/__tests__/.* | |
.*/cypress/.* | |
[include] | |
[libs] | |
flow-typed |
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
{ | |
"public": "public", | |
"rewrites": [{ "source": "/**", "destination": "/index.html" }] | |
} |
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
{ | |
"scripts": { | |
"build": "rollup -c --prod --mini", | |
"watch": "rollup -c -w", | |
"serve": "serve" | |
} | |
} |
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
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); | |
workbox.precaching.suppressWarnings(); | |
// the following line will be replaced by workbox-cli | |
workbox.precaching.precacheAndRoute([]); | |
// Cache unpkg (for systemjs) | |
workbox.routing.registerRoute( | |
/^https:\/\/unpkg\.com/, | |
workbox.strategies.cacheFirst({ |
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
module.exports = { | |
"globDirectory": "public", | |
"globPatterns": [ | |
"**/*.html", | |
"js/esm/*.js", | |
], | |
"swDest": "public/js/esm/sw.js", | |
"swSrc": "./src/sw.js", | |
"modifyUrlPrefix": { | |
"js/": "/js/", |
OlderNewer