npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app
:root { | |
--lineHeightFixedAmount: 0.25rem; | |
--lineHeightRelativeAmount: 1em; | |
--sizesIncrement: 1.4; | |
--fontSize-0: 1rem; | |
--fontSize-1: calc(var(--fontSize-0) * var(--sizesIncrement)); | |
--fontSize-2: calc(var(--fontSize-1) * var(--sizesIncrement)); | |
--globalLineHeight: calc(var(--lineHeightFixedAmount) + var(--lineHeightRelativeAmount)); |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
NUMBER | CODE | SERIAL | NAME | TYPE1 | TYPE2 | COLOR | ABILITY1 | ABILITY2 | ABILITY HIDDEN | GENERATION | LEGENDARY | MEGA_EVOLUTION | HEIGHT | WEIGHT | HP | ATK | DEF | SP_ATK | SP_DEF | SPD | TOTAL | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 1 | 11 | Bulbasaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 0.7 | 6.9 | 45 | 49 | 49 | 65 | 65 | 45 | 318 | ||
2 | 1 | 21 | Ivysaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 1 | 13 | 60 | 62 | 63 | 80 | 80 | 60 | 405 | ||
3 | 1 | 31 | Venusaur | Grass | Poison | Green | Overgrow | Chrolophyll | 1 | 0 | 0 | 2 | 100 | 80 | 82 | 83 | 100 | 100 | 80 | 525 | ||
3 | 2 | 32 | Mega Venusaur | Grass | Poison | Green | Thick Fat | 1 | 0 | 1 | 2.4 | 155.5 | 80 | 100 | 123 | 122 | 120 | 80 | 625 | |||
4 | 1 | 41 | Charmander | Fire | Red | Blaze | Solar Power | 1 | 0 | 0 | 0.6 | 8.5 | 39 | 52 | 43 | 60 | 50 | 65 | 309 | |||
5 | 1 | 51 | Charmeleon | Fire | Red | Blaze | Solar Power | 1 | 0 | 0 | 1.1 | 19 | 58 | 64 | 58 | 80 | 65 | 80 | 405 | |||
6 | 1 | 61 | Charizard | Fire | Flying | Red | Blaze | Solar Power | 1 | 0 | 0 | 1.7 | 90.5 | 78 | 84 | 78 | 109 | 85 | 100 | 534 | ||
6 | 2 | 62 | Mega Charizard X | Fire | Dragon | Black | Tough Claws | 1 | 0 | 1 | 1.7 | 110.5 | 78 | 130 | 111 | 130 | 85 | 100 | 634 | |||
6 | 3 | 63 | Mega Charizard Y | Fire | Flying | Red | Drought | 1 | 0 | 1 | 1.7 | 90.5 | 78 | 104 | 78 | 159 | 115 | 100 | 634 |
import { useEffect, useReducer } from 'react'; | |
type State<TState, TEffect> = TState & { | |
effects?: TEffect[]; | |
}; | |
export type UseFsmReducerEffects<TAction, TEffect extends { type: string }> = { | |
[K in TEffect['type']]: (params: { | |
effect: Extract<TEffect, { type: K }>; | |
dispatch: (action: TAction) => void; |
// styled component version | |
const Container = styled.div` | |
/*all of the styles*/ | |
` | |
function MyComponent() { | |
return <Container>{/*other stuff*/}</Container> | |
} | |
// css prop version |
import log from "ololog" | |
class Grid { | |
rows = [] | |
width = 0 | |
height = 0 | |
chars = { | |
active: ["┌", "─", "┒", "┃", "┛", "━", "┕", "│"], | |
inactive: ["┌", "─", "┐", "│", "┘", "─", "└", "│"], |
/* | |
* Change from https://gist.github.com/unki2aut/4ac81c33be2e8f121e80a26eba1735d7 | |
* - Use top level await (Node.js v14.8.0+) | |
* - To use top level await, you need to write a script as ES Modules | |
* - Set chokidar options to avoid duplicate building | |
* - Define NODE_ENV (For React) | |
* - Add API proxy setting by using proxy-middleware | |
*/ | |
import chokidar from "chokidar"; | |
import esbuild from "esbuild"; |
interface LifecycleFunction { | |
(): void; | |
} | |
interface EventCallback<T = unknown> { | |
(event: CustomEvent<T>): void; | |
} | |
export namespace Svelte { | |
export interface Fragment { | |
key?: string | null; | |
first?: Comment | null; |
// codecols designed after Rasmus Andersson's linelen_hist.sh | |
// https://gist.github.com/rsms/36bda3b5c8ab83d951e45ed788a184f4 | |
{ | |
println: println | |
default: default | |
map: map | |
stdin: stdin | |
range: range | |
filter: filter |