Skip to content

Instantly share code, notes, and snippets.

if git apply --check --ignore-space-change --ignore-whitespace --directory node_modules/typescript/ typescript.patch 2> /dev/null; then
git apply --verbose --ignore-space-change --ignore-whitespace --directory node_modules/typescript/ typescript.patch
fi
@psxcode
psxcode / vscode-tooltip.css
Created October 20, 2019 00:22
change tooltip size in vscode
/* https://marketplace.visualstudio.com/items?itemName=be5invis.vscode-custom-css */
/* https://marketplace.visualstudio.com/items?itemName=lehni.vscode-fix-checksums */
/* sudo chown -R $(whoami) /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron */
/* code ~/.vscode-custom.css */
.monaco-editor-hover-content {
max-width: 2000px !important;
max-height: 1000px !important;
}
@psxcode
psxcode / config.yml
Last active August 16, 2021 20:26
Verdacio config
max_body_size: 100mb
storage: /opt/verdaccio/storage
auth:
htpasswd:
file: /opt/verdaccio/htpasswd
uplinks:
npmjs:
url: https://registry.npmjs.org/
packages:
'@*/*':
@psxcode
psxcode / remove-yarn-cache.ts
Created August 2, 2020 15:41
Auto hook to clear packages from yarn cache
import type { THook, THookProps } from '@auto/core'
import type { TReadonly } from 'tsfn'
const getYarnCacheDir = async () => {
const { default: execa } = await import('execa')
const { stdout: yarnCacheDir } = await execa('yarn', ['cache', 'dir'])
return yarnCacheDir
}
@psxcode
psxcode / .gitattributes
Created August 16, 2021 20:28
Unity LFS attributes
* text=auto
# Unity files
*.asset linguist-generated -text -merge=unityamlmerge
*.mat linguist-generated -text -merge=unityamlmerge
*.meta linguist-generated -text -merge=unityamlmerge
*.prefab linguist-generated -text -merge=unityamlmerge
*.unity linguist-generated -text -merge=unityamlmerge
# Image formats
@psxcode
psxcode / xor.ts
Created March 21, 2024 10:20
XOR Typescript type
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
type XOR<T, U> = (T | U) extends object
? (Without<T, U> & U) | (Without<U, T> & T)
: T | U
// Example
type RenderProps = XOR<
{ children: (api: API) => ReactNode },
{ render: (api: API) => ReactNode }