sudo apt install fonts-noto-color-emoji
For themes, use https://github.com/adi1090x/kitty-cat. This modifies config a lot so do this first before applying any kitty config. Mostly it changes font properties and margin.
'use script' | |
function loadScript(filePath, cacheBuster = `?bust=${new Date().getTime()}`) { | |
const scriptTag = document.createElement('script'); | |
scriptTag.onload = () => console.log('loaded'); | |
scriptTag.type = 'text/javascript'; | |
scriptTag.src = `${filePath}${cacheBuster}`; | |
document.querySelector('head').appendChild(scriptTag); | |
} |
sudo apt install fonts-noto-color-emoji
For themes, use https://github.com/adi1090x/kitty-cat. This modifies config a lot so do this first before applying any kitty config. Mostly it changes font properties and margin.
# C:/Users/zlksnk/.wslconfig | |
# [wsl2] | |
# kernel=<path> # An absolute Windows path to a custom Linux kernel. | |
# memory=<size> # How much memory to assign to the WSL2 VM. | |
# processors=<number> # How many processors to assign to the WSL2 VM. | |
# swap=<size> # How much swap space to add to the WSL2 VM. 0 for no swap file. | |
# swapFile=<path> # An absolute Windows path to the swap vhd. | |
# localhostForwarding=<bool> # Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhost:port (default true). |
{ | |
"React useState": { | |
"scope": "javascript,typescript,typescriptreact", | |
"prefix": "rus", | |
"body": "const [${1}, set${1/(.*)/${1:/capitalize}/}] = useState(${3})", | |
"description": "Create a React useState hook" | |
}, | |
"React import": { | |
"scope": "javascript,typescript,typescriptreact", | |
"prefix": "imr", |
type ValueType< | |
S extends string, | |
R extends Record<string, any> | |
> = S extends `${infer T}.${infer U}` ? ValueType<U, R[T]> : R[S]; | |
export type Dotted< | |
S extends string, | |
R extends Record<string, any> | |
> = ValueType<S, R> extends infer A | |
? unknown extends A |
More TS utils:
More surprises:
export PATH="$PATH:/home/frefko/Downloads/platform-tools" | |
export PATH="/mnt/Media/proj/installed/jdk1.8.0_144/bin:$PATH" | |
export PATH="$HOME/.local/bin:$PATH" | |
export PYENV_ROOT="$HOME/.pyenv" | |
export PATH="$PYENV_ROOT/bin:$PATH" | |
pyenv init - | source |
import React, { ReactElement, useState, useLayoutEffect } from 'react'; | |
import { Routes, Route } from 'react-router-dom'; | |
import type { RoutesProps, RouteProps } from 'react-router'; | |
const AliveAbleRoutes = ({ children, ...props }: RoutesProps) => { | |
const routes = React.Children.toArray(children); | |
const keepAliveRoutes = routes.filter((route) => { | |
if (!React.isValidElement(route)) return false; | |
return route.type === KeepAliveRoute; |
Uses a feature of React Router v6 internally to have more flexibility over naming of the keys.
Needs two params:
Inspired by a hook used in Remix. (Watch this video)
Taken from an answer found in StackOverflow
Say you have
<Section>
<SectionHeader />
<SectionContent />
</Container>