See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
| fd package.json -x jq -r '"\(.dependencies + .devDependencies | to_entries | .[] | "\(.key)@\(.value)")"' {} | sort | uniq -d |
See how a minor change to your commit message style can make a difference.
Tip
Have a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs
| type Primitive = null | undefined | string | number | boolean | symbol | bigint; | |
| function isObject(item: unknown): item is Record<string, unknown> { | |
| return typeof item === 'object' && item !== null && !Array.isArray(item); | |
| } | |
| /** | |
| * Merge objects, second objects overwrites the keys of the first objects | |
| */ | |
| function deepMerge<T extends Record<string, unknown>, U extends Record<string, unknown>>(target: T, source: U): T & U { |
| Command | Description |
|---|---|
git blame -L 28,43 path/to/file |
Shows who modified each line in a specific range of a file. |
git blame -L :'class LocalFile' filepath |
Blames a block of code in a file matching a specific pattern. |
git log -L28,43:filepath |
Lists commits that last touched a specified region of a file. |
git blame -w |
Ignores whitespace changes in git blame. |
git blame -C |
Follows code movement across files in git blame. Can be used up to three ti |
| # Delete node_modules using fd (github.com/sharkdp/fd) | |
| fd -HI node_modules -X rm -rf |
| // Credits to Matt Pocock | |
| type CreateAPIMethod = < | |
| TInput extends Record<string, string>, // The input | |
| TOutput // The output | |
| >(opts: { | |
| url: string; | |
| method: "GET" | "POST" | |
| }) = (input: TInput) = Promise<TOutput>; | |
| declare const createAPIMethod: CreateAPIMethod; |
| /* The scrollbar-gutter CSS property allows authors to reserve space for the scrollbar, preventing unwanted layout changes as the content grows while also avoiding unnecessary visuals when scrolling isn't needed. */ | |
| /* https://developer.mozilla.org/en-US/docs/Web/CSS/scrollbar-gutter */ | |
| .scrollbar { | |
| scrollbar-gutter: stable; | |
| } |
| /** | |
| * A strategy for fetching data from the server. | |
| * | |
| * @callback FetchStrategy | |
| * @param {string} url - The URL to fetch data from. | |
| * @param {RequestInit} [options] - Additional options for the fetch request. | |
| * @returns {Promise<Response>} A promise that resolves to the fetch response. | |
| */ | |
| export type FetchStrategy = ( | |
| url: string, |
| enum ResultKind { | |
| OK = "Ok", | |
| ERR = "Err", | |
| } | |
| export type Result<T, E> = Ok<T> | Err<E>; | |
| interface ResultBase<A, E> { | |
| kind: ResultKind; | |
| map<B>(fn: (_: A) => B): Result<B, E>; |