create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
import React, {PropTypes} from 'react'; | |
import { debounce } from 'lodash'; | |
// A simple helper component, wrapping retina logic for canvas and | |
// auto-resizing the canvas to fill its parent container. | |
// To determine size/layout, we just use CSS on the div containing | |
// the Canvas component (we're using this with flexbox, for example). | |
// Expects a "paint" function that takes a "context" to draw on | |
// Whenever this component updates it will call this paint function | |
// to draw on the canvas. For convenience, pixel dimensions are stored |
/** | |
* A pure version of Array.prototype.splice | |
* It will return a new array rather than mutate the array | |
* See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | |
* @param {Array} array The target array | |
* @param {number} start Index at which to start changing the array | |
* @param {number} deleteCount An integer indicating the number of old array elements to remove | |
* @param {any} items The elements to add to the array, beginning at the start index | |
* @returns {Array} | |
*/ |
<html> | |
<head> | |
</head> | |
<input type="file" id="fileInput" onchange="handleFiles(this.files)"/> | |
<div id="pyodide"/> | |
<body> | |
<script type="text/javascript"> | |
self.languagePluginUrl = "/python/" |
This is a simple Tailwind plugin to expose all of Tailwind's colors, including any custom ones, as custom css properties on the :root
element.
There are a couple of main reasons this is helpful:
See the Tailwind Plugins for more info on plugins.
type ValidatorResult<T> = { type: "valid" } | { type: "invalid"; error: string } | |
type ValidateFn<T> = (value: unknown) => ValidatorResult<T> | |
type Validator<T = unknown> = { | |
validate: ValidateFn<T> | |
parse: (value: unknown) => T | |
is: (value: unknown) => value is T | |
} |
const { | |
useState, | |
useRef, | |
createRef, | |
useEffect | |
} = React; | |
const data = [ | |
{ | |
text: "test1" |
export function useThrottle<T>(value: T, limit = 1000) { | |
const [throttledValue, setThrottledValue] = useState(value); | |
const lastRan = useRef(Date.now()); | |
useEffect(() => { | |
const handler = setTimeout(() => { | |
if (Date.now() - lastRan.current >= limit) { | |
setThrottledValue(value); | |
lastRan.current = Date.now(); | |
} |
export const chaosTestStrings = (): void => { | |
const textNodes = getAllTextNodes(document.body); | |
for (const node of textNodes) { | |
const textNodeLength = node.textContent ? node.textContent.length : 0; | |
if (node.textContent === null) { | |
return; | |
} | |
if (node.parentElement instanceof Element) { | |
if (node.parentElement.dataset.originalText === undefined) { |
type Props<TagName extends keyof JSX.IntrinsicElements | void = void> = { | |
as?: TagName; | |
children?: React.ReactNode; | |
attributes?: Attributes<TagName>; | |
}; | |
export type Attributes<TagName = void, O = void> = Omit< | |
(TagName extends keyof JSX.IntrinsicElements | |
? JSX.IntrinsicElements[TagName] |