Skip to content

Instantly share code, notes, and snippets.

months = ['January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
function delay(fn, t) {
// private instance variables
var queue = [], self, timer;
function schedule(fn, t) {
timer = setTimeout(function() {
timer = null;
fn();
if (queue.length) {
var item = queue.shift();
const compose = (...fns) => data =>
fns.reduceRight((value, fn) => fn(value), data)
const trim = str => str.trim()
const split = separator => str => str.split(separator)
const notEmpty = str => str.length > 0
const removeEmpty = parts => parts.filter(notEmpty)
const compose = (...functions) => data =>
functions.reduceRight((value, func) => func(value), data) // right to left
const pipe = (...functions) => data =>
functions.reduce((value, func) => func(value), data) // left to right
const encodeAttribute = (x = '') => x.replace(/"/g, '"')
const toAttributeString = (x = {}) =>
Object.keys(x)
.map(attr => `${encodeAttribute(attr)}="${encodeAttribute(x[attr])}"`)
li {
list-style-type: none;
position: relative;
margin: 2px;
padding: 0.5em 0.5em 0.5em 2em;
background: lightgrey;
font-family: sans-serif;
}
li.done {
<html>
<head>
<title>Critical Path: Measure</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="style.css" rel="stylesheet">
<script>
function measureCRP() {    
var t = window.performance.timing,
     interactive = t.domInteractive - t.domLoading,
/**
* QuadTree object.
*
* The quadrant indexes are numbered as below:
* |
* 1 | 0
* —-+—-
* 2 | 3
* |
*/
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
        <title>Example Feed</title>
        <subtitle>A subtitle.</subtitle>
        <link href="http://example.org/feed/" rel="self" />
        <link href="http://example.org/" />
        <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
        <updated>2003-12-13T18:30:02Z</updated>