Skip to content

Instantly share code, notes, and snippets.

View its-monotype's full-sized avatar
🤙

its-monotype

🤙
  • Earth
View GitHub Profile
@DominusKelvin
DominusKelvin / settings.json
Created October 16, 2024 06:54
My Minimalist and Attractive VS Code Settings
{
"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": {
@CaptainVincent
CaptainVincent / README.md
Last active February 20, 2025 00:23
Improve your vscode quickinput-widget

Customize your quickinput-widget

This is a small tool designed to emulate the Sublime style Command Palette as follows.

Screenshot

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.

@bitterteasweetorange
bitterteasweetorange / keybindings.json
Last active March 27, 2025 09:56
setup vscode like neovim
[
{
"command": "projectManager.listGitProjects#sideBarGit",
"key": "cmd+o"
},
{
"command": "expand_region",
"key": "ctrl+=",
"when": "editorTextFocus"
},
@palashmon
palashmon / Prettify.ts
Created May 13, 2023 16:11
A super useful type helper in TypeScript by Matt Pocock from Twitter
/**
* 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];
} & {};
@levvsha
levvsha / useOnClickOutside.ts
Created May 9, 2023 12:44
useOnClickOutside react hook with TypeScript
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);
@martinratinaud
martinratinaud / .gitconfig
Last active December 19, 2024 18:45
Awesome Git Configuration
[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
@bennettdams
bennettdams / zod-empty-string-undefined-optional.ts
Last active July 24, 2024 09:15
Zod empty string transformed to `undefined` including handling optional
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:
*
@HughParsons
HughParsons / forwardRefHOC.tsx
Created September 9, 2022 00:04
React HOC (higher order component) with forwardRef
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} />
);
@Zekfad
Zekfad / conventional-commits.md
Last active April 23, 2025 08:34
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • 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, libraries
@vtenq
vtenq / git-workflow.md
Last active January 20, 2025 12:19
Git workflow with conventional commits and semantic auto release

Git workflow with conventional commits and semantic auto release

This is an adoptation of Git flow by Vincent Driessen with conventional commits and semantic release.

The main concepts

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: