Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
var mapDOM = function (elem) { | |
return { | |
NODE: elem, | |
ATTRIBUTES: elem.attributes, | |
PARENT: elem.parentNode, | |
CHILDREN: Array.prototype.map.call(elem.childNodes, function (child) { | |
return mapDOM(child); | |
}) | |
}; | |
}; |
/** | |
* Teroy: The smallest JavaScript state-based component UI renderer - "Keepin' it Vanilla." | |
* Length: 100 lines. | |
* Global support: 93.89% (https://caniuse.com/#feat=proxy) | |
* Github: https://github.com/MathiasWP/TeroyJS | |
* NPM: https://www.npmjs.com/package/teroy | |
* Creator: Mathias Picker. | |
* License: MIT | |
*/ |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
addEventListener('fetch', function (event) { | |
event.respondWith(handleRequest(event.request)); | |
}); | |
// Allowed domain origins | |
var allowed = ['http://localhost:8000', 'https://your-website.com']; | |
/** | |
* Respond to the request | |
* @param {Request} request |
// | |
// This part goes on Cloudflare Workers | |
// | |
addEventListener('fetch', function (event) { | |
event.respondWith(handleRequest(event.request)); | |
}); | |
/** | |
* Available discounts |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Array.find()</title> | |
</head> | |
<body> | |
<script> | |
// | |
// IE9 Support |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Classes</title> | |
</head> | |
<body> | |
<script> | |
// This is a Contructor inside a Revealing Module Pattern | |
// It creates the scoped namespace for the entire set of methods |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Loop Performance</title> | |
<style type="text/css"> | |
body { | |
margin: 1em auto; | |
max-width: 40em; | |
text-align: center; |
// The core app code | |
var myApp = (function () { | |
'use strict'; | |
// Create a public methods object | |
var methods = {}; | |
/** | |
* Extend the public methods object |