- Download and extract zip from here
- Press
Windows + x
- Press
a
(Selects PowerShell (Admin)) - Navigate to directory where fonts were extracted to (
cd ${HOME}\Downloads\fonts-master\fonts-master
) - Set Execution Policy
Set-ExecutionPolicy RemoteSigned
[1] - Press
y
thenEnter
to accept
This file contains 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
/** | |
* Checks if the specified Web Storage API exists and is accessible | |
* @param storage - Web Storage API | |
* @returns true, if the Web Storage API is accessible | |
*/ | |
const isStorageEnabled = (storage?: Storage): storage is Storage => { | |
if (!storage) return false; | |
try { | |
const key = `__storage__test`; | |
storage.setItem(key, ''); |
This file contains 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') | |
module.exports = async function customServer(app, settings, proxyConfig) { | |
const handle = app.getRequestHandler() | |
await app.prepare() | |
const server = express() | |
if (proxyConfig) { | |
const proxyMiddleware = require('http-proxy-middleware') | |
Object.keys(proxyConfig).forEach(context => { |
This file contains 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
/* | |
TODO: | |
X Maybe account for defaults: color: var(--header-color, blue); | |
- Verify cross domain working or not (it is working from dropbox) | |
- Option to wait to apply anything until all <link>s are parsed or inject what we have and update as each <link> returns | |
- Need to test on a more complex CSS file | |
- Option to save parsed file in local/session storage so there isn't a delay on additional page loads. Could only do it for links (with URLs to use as keys) and style blocks with IDs of some sort | |
- Need to test more complex values like rgba(255,0,0,0.5); and something with !important | |
- Try multiple links | |
- Local links |
This file contains 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
import { createContext, createElement, useContext, useEffect, useMemo, useState, ReactNode } from 'react' | |
import { useFormContext } from 'react-hook-form' | |
function createFieldArray<T>(name: string) { | |
const storeContext = createContext() | |
function StoreProvider({children, defaultValue}: {children: ReactNode, defaultValue: T[]}) { | |
const { register, setValue, unregister } = useFormContext() | |
const [items, setItems] = useState<T[]>(defaultValue) | |
|
This file contains 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
import { useEffect, useState } from 'react' | |
import { useFormContext } from 'react-hook-form' | |
export default function useArrayField<T>({ name, defaultValue = [] }: { name: string; defaultValue?: T[] }) { | |
const { register, setValue, unregister } = useFormContext() | |
const [items, setItems] = useState<T[]>(defaultValue) | |
// Manually register our array field | |
useEffect(() => { | |
register({ name }) |
This file contains 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 values = { | |
'property': 'foo', | |
'categories[1]': 'action', | |
'categories[0]': 'adventure', | |
'debug.works': 'true', | |
'person[0].active': 'true', | |
'person[0].name.first': 'testFirst', | |
'person[0].name.last': 'testLast', | |
'person[0].numbers[0]': '1234', | |
'person[0].numbers[1]': '5678', |
This file contains 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
class MyIntersectionObserver extends HTMLElement { | |
constructor() { | |
super(); | |
this._observer = null; | |
this._visited = false; | |
this._root = null; | |
this._rootMargin = '0px'; | |
this._threshold = 0; | |
this._shadowRoot = this.attachShadow({ mode: 'open' }); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Untitled benchmark</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains 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
import "@webcomponents/shadycss/custom-style-interface.min.js"; | |
const { CustomStyleInterface } = window.ShadyCSS; | |
class ShadyStyle extends HTMLElement { | |
__style = null; | |
constructor() { | |
super(); |
NewerOlder