This is a small tool designed to emulate the Sublime style Command Palette as follows.
It requires the use of a specific extension to load the js file from this gist.
I'm using the APC extension, and the usage is as follows.
{ | |
"js/ts.implicitProjectConfig.checkJs": true, | |
"security.workspace.trust.untrustedFiles": "open", | |
"editor.accessibilitySupport": "off", | |
"editor.foldingHighlight": false, | |
"window.commandCenter": true, | |
"editor.quickSuggestions": { | |
"strings": true | |
}, | |
"tailwindCSS.includeLanguages": { |
This is a small tool designed to emulate the Sublime style Command Palette as follows.
It requires the use of a specific extension to load the js file from this gist.
I'm using the APC extension, and the usage is as follows.
[ | |
{ | |
"command": "projectManager.listGitProjects#sideBarGit", | |
"key": "cmd+o" | |
}, | |
{ | |
"command": "expand_region", | |
"key": "ctrl+=", | |
"when": "editorTextFocus" | |
}, |
/** | |
* A TypeScript type alias called `Prettify`. | |
* It takes a type as its argument and returns a new type that has the same properties as the original type, | |
* but the properties are not intersected. This means that the new type is easier to read and understand. | |
*/ | |
type Prettify<T> = { | |
[K in keyof T]: T[K]; | |
} & {}; |
function useOnClickOutside( | |
ref: React.RefObject<HTMLDivElement>, | |
handler: (event: TouchEvent | MouseEvent) => void, | |
) { | |
useEffect(() => { | |
const listener = (event: TouchEvent | MouseEvent) => { | |
if (!ref.current || ref.current.contains(event.target as HTMLElement)) { | |
return; | |
} | |
handler(event); |
[alias] | |
# shortcuts | |
c = commit | |
co = checkout | |
cp = cherry-pick | |
f = fetch | |
# enhancements | |
d = diff -- ':!package-lock.json' ':!yarn.lock' # Do not show lock files when diffing | |
ds = diff --staged -- ':!package-lock.json' ':!yarn.lock' # Do not show lock files when diffing staged files |
import { z } from 'zod' | |
const emptyStringToUndefined = z.literal('').transform(() => undefined) | |
/** | |
* Provide a schema and get a schema that is optional and empty strings are transformed to `undefined`. | |
* When someone removes his input of this field, the then empty string is transformed to `undefined`. | |
* | |
* Example: | |
* |
import * as React from 'react' | |
export function HOC<T, P extends {}>( | |
Component: React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> | |
): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<T>> { | |
return React.forwardRef<T, P>( | |
function ComponentFromHOC(props, ref) { | |
return ( | |
<Component {...props as React.PropsWithoutRef<P>} ref={ref} /> | |
); |
feat: new feature
fix(scope): bug in scope
feat!: breaking change
/ feat(scope)!: rework API
chore(deps): update dependencies
build
: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)ci
: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)chore
: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, librariesThis is an adoptation of Git flow by Vincent Driessen with conventional commits and semantic release.
At the core, the development model is greatly inspired by existing models out there. The central repo holds two main branches with an infinite lifetime: