Skip to content

Instantly share code, notes, and snippets.

View abelflopes's full-sized avatar
🚀

Abel abelflopes

🚀
View GitHub Profile
@abelflopes
abelflopes / tsconfig.json
Created June 24, 2026 23:19
A TypeScript 6 tsconfig.json with all options organised by category, documentation comments & explanations, and defaults applied
{
// Visit https://aka.ms/tsconfig to read more about this file
"$schema": "https://json.schemastore.org/tsconfig",
// If no 'files' or 'include' property is present in a tsconfig.json, the compiler defaults to including all files in the containing directory and subdirectories except those specified by 'exclude'. When a 'files' property is specified, only those files and those specified by 'include' are included.
// "files": [],
// Path to base configuration file to inherit from..
// "extends": [],
// Specifies a list of glob patterns that match files to be included in compilation.
// "include": [],
// Specifies a list of files to be excluded from compilation.
@abelflopes
abelflopes / README.md
Last active August 24, 2023 17:27
Sourcetree Custom Actions

Sourcetree Custom Actions

This gist is a collection of custom actions for Sourcetree. The actions abstract useful git commands & combinations.

Creating a custom action on Sourcetree

  1. Open sourcetree on a repository
  2. Go to the "OS top bar" > "Actions" > "Custom Actions" > "Edit..."
  3. You should now be on Sourcetree settings with the "Custom Actions" tab selected
@abelflopes
abelflopes / array-utils.ts
Last active August 30, 2022 15:27
Utils to remove repeated items from array & to sort based on equality
const getEqualitySorter =
<T = unknown>(sortList: T[]) =>
(a: T, b: T): number => {
for (const i in sortList) {
const orderItem = sortList[i];
if (a === orderItem && b !== orderItem) return -1;
if (a !== orderItem && b === orderItem) return 1;
}
@abelflopes
abelflopes / debounce.ts
Created August 22, 2022 20:51
Typescript debounce
type TimeOutSheet = Record<string, ReturnType<typeof setTimeout | typeof clearTimeout>>;
const timeOutSheet: TimeOutSheet = {};
const getFnId = (fn: () => unknown): string => {
return [fn.name, fn.toString()].join("").split(" ").join("");
};
export const debounce = (callback: () => void, ms: number): void => {
const toId = timeOutSheet[getFnId(callback)];