Skip to content

Instantly share code, notes, and snippets.

View wazeerc's full-sized avatar
🐞
Stuck in vim since 2019

Wazeer wazeerc

🐞
Stuck in vim since 2019
View GitHub Profile
@wazeerc
wazeerc / .prettierrc.json
Created November 16, 2024 14:56
Prettier Sort Imports
{
...
"importOrder": [
"^(.*).css$",
"^react$",
"<THIRD_PARTY_MODULES>",
"^@components/(.*)$",
"^@hooks/(.*)$",
"^[./]"
],
@wazeerc
wazeerc / snippets.code-snippets
Created October 17, 2024 07:24
JavaScript/TypeScript snippets for VSCode
{
// File located in: "C:\Users\<UserNAme>\AppData\Roaming\Code\User\snippets\"
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
@wazeerc
wazeerc / tsconfig.app.json
Last active October 5, 2024 19:56
My preferred TypeScript config 🛠️
{
"compilerOptions": {
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitAny": true
}
}
@wazeerc
wazeerc / .prettierrc.json
Last active September 7, 2024 07:12
My preferred Prettier config 🪄
{
"printWidth": 85,
"arrowParens": "avoid",
"tabWidth": 2,
"singleQuote": false,
"jsxSingleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false
}
@wazeerc
wazeerc / commits101.md
Created August 26, 2024 13:50
Conventional Commit Message

Conventional Commit Messages

Types

  • API relevant changes
    • feat Commits, that adds or remove a new feature
    • fix Commits, that fixes a bug
  • refactor Commits, that rewrite/restructure your code, however does not change any API behaviour
    • perf Commits are special refactor commits, that improve performance
  • style Commits, that do not affect the meaning (white-space, formatting, missing semi-colons, etc)
@wazeerc
wazeerc / genRecommendation.ts
Last active September 3, 2024 11:13
Algorithm used to generate a number of recommendations based on selected movies (used in my movie-recs project).
/**
* @summary Generates recommendations based on selected items and custom criteria using a point-based system.
* @param allItems - An array of all available items.
* @param selectedItems - An array of selected items.
* @param criteria - An array of functions to calculate points based on different criteria.
* @param numberOfRecommendations - The number of recommendations to generate, defaults to 3.
* @returns An array of recommended items.
* @example
* const allItems = [1, 2, 3, 4, 5];
* const selectedItems = [1, 2];