This file contains hidden or 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 assert = require('assert') | |
const lolex = require('lolex') | |
class CountdownTimerWithSetTimeout { | |
countdownFrom(n, element) { | |
element.innerText = n | |
setTimeout(() => { | |
n-- | |
element.innerText = n | |
if (n > 0) { |
This file contains hidden or 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
var hyperdom = require('hyperdom') | |
var h = hyperdom.html | |
class App { | |
render() { | |
return h('.container', | |
h('#example', | |
h('div.foo div', h('input[type=submit]')) | |
), | |
h.component({ |
This file contains hidden or 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 express = require("express"); | |
const cheerio = require("cheerio"); | |
const httpism = require("httpism"); | |
if (process.env.PORT) { | |
startApp({ port: process.env.PORT, fetchCities }) | |
} else { | |
module.exports = startApp | |
} |
This file contains hidden or 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
1:00 | |
one o'clock | |
2:05 | |
five past two | |
3:10 | |
ten past three | |
4:15 |
This file contains hidden or 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 getMicroDataFromElement(element) { | |
element = element || document.body | |
function descendToAttribute(scope, attribute) { | |
return [].slice.apply(scope.children).reduce(function(props, child) { | |
return props.concat( | |
child.hasAttribute(attribute) ? [child] : descendToAttribute(child, attribute) | |
) | |
}, []) | |
} |
OlderNewer