Skip to content

Instantly share code, notes, and snippets.

@zhjgithub
zhjgithub / 0_reuse_code.js
Created February 26, 2017 06:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Title of your Feed</title>
<link>http://www.yourwebsite.com/</link>
<description>This is the description of your Feed.
Keep it to one or two sentences.</description>
<item>
<title>Content Title</title>
<link>Direct URL to content</link>
<guid>Unique ID for content. Copy the URL again</guid>
<pubDate>Wed, 27 Nov 2013 15:17:32 GMT
(Note: The date must be in this format)</pubDate>
<description>Description for your content.</description>
</item>
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>My Cool Blog</title>
<link>http://www.yourwebsite.com/</link>
<description>My latest cool articles</description>
<item>
<title>Article 3</title>
<link>example.com/3</link>
<guid>example.com/3</guid>
<?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>
/**
* QuadTree object.
*
* The quadrant indexes are numbered as below:
* |
* 1 | 0
* —-+—-
* 2 | 3
* |
*/
<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,
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 {