A Router
is a stateful container for an array of (Request
, Response
) tuples.
The following:
const target = new EventTarget(); | |
setInterval(() => { | |
target.dispatchEvent(new Event("event-a")); | |
}, 3333); | |
setInterval(() => { | |
target.dispatchEvent(new Event("event-b")); | |
}, 4444); |
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text" encoding="utf-8" /> | |
<xsl:template match="/"> | |
<xsl:text>{"areas":[</xsl:text> | |
<xsl:for-each select="/map/areas/area"> | |
<xsl:text>{"id":"</xsl:text> | |
<xsl:value-of select="@id" /> | |
<xsl:text>","name":"</xsl:text> | |
<xsl:value-of select="@name" /> |
import CMS from "netlify-cms-app"; | |
import { createElement, useState } from "react"; | |
const widget = { | |
control: BetterTextWidgetControl, | |
name: "betterTextWidget", | |
preview: BetterTextWidgetPreview, | |
}; | |
export default widget; |
/** | |
* @module | |
* Window and worker friendly fetch caching | |
*/ | |
import { CACHE_NAME } from "./constants"; | |
/** | |
* Always sends the fetch request and the response is always cached. The cache is never read. | |
* This is useful if a non-cached response is required, but the cache should still be updated |
/** | |
* @template StateKey - Any value used to index a Map of Q | |
* @template Transition - Any value used to index a Map of Transitions and an undefined value is an epsilon acceptor. Non-epsilon transitions are attempted first | |
* @param {Map<StateKey & any, Map<Transition | undefined, ((transition?: any & StateKey) => StateKey)>>} Q - Where q0 is first q in Q, and final states are q in Q with empty transitions | |
* @returns {Iterable<StateKey>} - Iterable machine where `machine.next(transition)` steps machine and returns next q. | |
*/ | |
export function dfaFactory(Q) { | |
/** @type {StateKey} */ | |
const q0 = Q.keys().next().value; | |
let q = q0; |
// Returns all named exports as though they were dynamic default exports | |
// https://reactjs.org/docs/code-splitting.html#named-exports | |
import { lazy } from 'react'; | |
/** | |
* @function lazyNamedExport | |
* @param {function} dynamicImportCallback | |
* @param {string} exportKey | |
* @description Returns all named exports as though they were dynamic default exports |
Mac users who want to dual-boot into Windows 10 use the Boot Camp Assistant to create legitimate bootable Windows 10 USBs. Unfortunately, these drives will only work on Mac machines. To create a Windows 10 bootable USB for PCs, some extra work is necessary. I used these steps to create a Windows 10 bootable USB on a macbook pro running Catalina so that I could install Windows 10 on a Lenovo ThinkCentre m900 Tiny.
shasum -a 256 ~/Downloads/{filename}.iso