scraped these colors from https://www.w3.org/TR/2018/REC-css-color-3-20180619/#html4
with
JSON.stringify(Array.from($0.querySelectorAll('tr :nth-child(3)')).map(f => f.textContent.trim()))
| I am a banana |
| module.exports = function () { | |
| return Promise.reject(new Error("Whoops")) | |
| } |
scraped these colors from https://www.w3.org/TR/2018/REC-css-color-3-20180619/#html4
with
JSON.stringify(Array.from($0.querySelectorAll('tr :nth-child(3)')).map(f => f.textContent.trim()))
| [ | |
| { | |
| "_etag": "df8a40ab1e555e3d620f59d6d619ce48", | |
| "branch": "tmos-tier2", | |
| "build": "0.0.1309", | |
| "created": "2019-02-27T08:01:31.594Z", | |
| "custom_metadata": { | |
| "dut_build": "0.0.1309", | |
| "dut_build_date": "Wed Feb 20 14:50:38 PST 2019", | |
| "dut_changelist": "2912505", |
| // borrowed from Addy Osmani | |
| // Way 1: new Set() | |
| const uniqueArray = arr => [...new Set(arr)]; | |
| uniqueArray(['Dan', 'Sarah', 'Sophie‘, ’Sarah']); | |
| // ["Dan", "Sarah", "Sophie"] | |
| // Way 2: Array.from() and new Set() | |
| const uniqueArray2 = arr => Array.from(new Set(arr)); |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <body> | |
| <div id="root"></div> | |
| <script type="module"> | |
| import { html, Component, render } from 'https://unpkg.com/htm/preact/index.mjs?module'; | |
| import Router from 'https://unpkg.com/preact-router?module'; | |
| const Home = () => html`<section><h1>Home</h1><p>This is the home page.</p></section>`; | |
| const About = () => html`<section><h1>About</h1><p>My name is Jason.</p></section>`; | |
| const NotFound = () => html`<section><h1>404: Not Found</h1><p>It's gone :(</p></section>`; |
| const { send } = require('micro') | |
| module.exports = (req, res) => send(res, 200, 'hello world!') |
| const fetch = require('isomorphic-unfetch') | |
| const { json, send } = require('micro') | |
| const { readFileSync } = require('fs') | |
| const { resolve } = require('path') | |
| // read template once | |
| const template = readFileSync(resolve(__dirname, './static/code.html'), 'utf8'); | |
| // encode html entities | |
| const entities = {'&': '&', '<': '<', '>': '>'}; |
| console.log('does this work?') |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Document</title> | |
| <link rel="stylesheet" href="https://unpkg.com/[email protected]/themes/prism.css" /> | |
| <script src="https://unpkg.com/[email protected]/prism.js"></script> | |
| </head> |