Skip to content

Instantly share code, notes, and snippets.

View adnanalbeda's full-sized avatar

Adnan AlBeda adnanalbeda

View GitHub Profile
@adnanalbeda
adnanalbeda / ThemeManager.tsx
Last active January 23, 2024 14:31
Vite_React_Tailwind
// *******************************************************
// * for tailwind, in order for this to work, *
// * must have this config: (darkMode: "class"). *
// *******************************************************
import {
createContext,
useCallback,
useContext,
useEffect,
@adnanalbeda
adnanalbeda / Config Files Manual.md
Last active May 1, 2023 18:41
For future me, Here you'll find the configs setup you need when you create a new React project

Configs Files

.editorconfig

This is a basic config which is required in all languages. It's the basic config for IDEs and Editors on how to handle formatting, etc.

Create .editorconfig file then change the following as you wish:

# EditorConfig is awesome: https://EditorConfig.org
// Insert an element after the selected element.
function insertElementAfter(referenceNode, newNode) {
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
}
@adnanalbeda
adnanalbeda / DevExtensions.ts
Last active April 19, 2022 10:49
A group of extension methods to debug and log data.
/* eslint-disable no-extend-native */
/*
* Too lazy to debug?
* This file provides basic (alert and console) commands as extension methods for development purposes.
* It can be anywhere inside the project and it should work just fine.
* However, for better readability, it's better to be located inside /src/extensions directory.
*/
// Export as Module