To make this work in CSS:
background: url('images.svg#chart');or img:
<img src="images.svg#chart">| { | |
| "aliceblue": "f0f8ff", | |
| "antiquewhite": "faebd7", | |
| "aqua": "00ffff", | |
| "aquamarine": "7fffd4", | |
| "azure": "f0ffff", | |
| "beige": "f5f5dc", | |
| "bisque": "ffe4c4", | |
| "black": "000000", | |
| "blanchedalmond": "ffebcd", |
| var slice = [].slice; | |
| function escape (value) { | |
| escape.el.innerText = value; | |
| return escape.el.innerHTML; | |
| } | |
| escape.el = document.createElement('pre'); | |
| function Buffer(frame, size) { | |
| if (!(this instanceof Buffer)) { |
| /** | |
| * Handling of multiple parallel async resolutions in one main callback. | |
| * | |
| * @param {Function} callback Function executed after all async stuff has finished. | |
| * | |
| * @return {Function} Proxy generator. | |
| */ | |
| function parallela(callback) { | |
| var args = {}; | |
| var proxies = 0; |
| function selhash(element) { | |
| if (!element || !element.nodeName) { | |
| return Object.prototype.toString.call(element) | |
| .match(/^\[object (\w+)\]$/i)[1] | |
| .toLowerCase() + ':' + element; | |
| } | |
| var parts = []; | |
| parts.push(element.nodeName.toLowerCase()); | |
| if (element.id) { | |
| parts.push('#' + element.id); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Test</title> | |
| <style> | |
| html, body {margin: 0; padding: 0; height: 100%; text-align: center; font-family: sans-serif;} | |
| ul {position: absolute; width: 100%; height: 100%; list-style: none; margin: 0; padding: 0;} | |
| ul li {float: left; width: 10%; height: 10%; background: #eee; box-shadow: -1px -1px 0 rgba(0,0,0,.2);} | |
| ul li:hover {background: #f78;} |
To make this work in CSS:
background: url('images.svg#chart');or img:
<img src="images.svg#chart">Node streams have a lot of issues. Awkward to control backpressure, no error propagation, overcomplicated implementation impenetrable to any view source attempts, etc...
To solve this, here is an implementation of pull-streams in modern JS, using promises, async iterators, and for..await loops.
Features:
| function search(needle, obj, ignore = null) { | |
| needle = needle.toLowerCase(); | |
| const objs = new Set(); | |
| _search(obj); | |
| function _search(obj, root = '') { | |
| if (!obj || typeof obj !== 'object' || objs.has(obj)) { | |
| return; | |
| } |
| async function buildScripts() { | |
| const rollup = require('rollup'); | |
| const typescript = require('@rollup/plugin-typescript'); | |
| const bundle = await rollup.rollup({ | |
| input: 'input.ts', | |
| plugins: [typescript()] | |
| }); | |
| await bundle.write({ |
| { | |
| "name": "test", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "testProcess.js", | |
| "scripts": { | |
| "start": "electron ." | |
| }, | |
| "author": "", | |
| "license": "ISC", |