Skip to content

Instantly share code, notes, and snippets.

View ixahmedxi's full-sized avatar

Ahmed Elsakaan ixahmedxi

View GitHub Profile
import path from 'path';
import { fileURLToPath } from 'url';
import comments from '@eslint-community/eslint-plugin-eslint-comments/configs';
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import nextPlugin from '@next/eslint-plugin-next';
import eslintConfigPrettier from 'eslint-config-prettier';
import hooksPlugin from 'eslint-plugin-react-hooks';
import reactRecommended from 'eslint-plugin-react/configs/recommended.js';
@ixahmedxi
ixahmedxi / globals.css
Created February 27, 2024 18:56
Storybook docs page tailwind dark mode
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
* {
@apply border-border;
}
body,
@ixahmedxi
ixahmedxi / keybindings.json
Created January 2, 2024 20:46
Vscode neovim keybindings.json
[
{
"command": "vscode-neovim.compositeEscape1",
"key": "j",
"when": "neovim.mode == insert && editorTextFocus",
"args": "j"
},
{
"command": "vscode-neovim.compositeEscape2",
"key": "k",
@ixahmedxi
ixahmedxi / init.vim
Created January 2, 2024 20:46
vscode neovim init.vim
" packadd quickscope
" execute 'luafile ' . stdpath('config') . '/lua/settings.lua'
function! s:manageEditorSize(...)
let count = a:1
let to = a:2
for i in range(1, count ? count : 1)
call VSCodeNotify(to == 'increase' ? 'workbench.action.increaseViewSize' : 'workbench.action.decreaseViewSize')
endfor
endfunction
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 20:45
VSCode settings.json
{
// open json editor for settings
"workbench.settings.editor": "json",
// Theme
"workbench.colorTheme": "Aura Dark",
"workbench.iconTheme": "moxer-icons",
// Change font
"editor.fontFamily": "Geist Mono",
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 08:05
My settings.json
{
"workbench.startupEditor": "none",
"workbench.iconTheme": "moxer-icons",
"workbench.colorTheme": "Aura Dark",
"workbench.settings.editor": "json",
"breadcrumbs.enabled": false,
"explorer.compactFolders": false,
"editor.wordWrap": "bounded",
"editor.tabSize": 2,
"editor.inlineSuggest.enabled": true,
@ixahmedxi
ixahmedxi / tsup.config.ts
Created December 2, 2023 13:38
tsup multi entrypoint
import fs from 'fs';
import path from 'path';
import { defineConfig } from 'tsup';
// INFO: This is the only place you need to update when adding new entry folders
const entryFolders = ['primitives', 'ui'];
function getAllFilesInDirectory(dirPath: string): string[] {
return fs.readdirSync(dirPath).reduce<string[]>((allFiles, file) => {
@ixahmedxi
ixahmedxi / component.tsx
Created September 25, 2023 23:23
React resizable panel
import { AnimatePresence, motion } from "framer-motion";
import { PropsWithChildren } from "react";
import useResizeObserver from "use-resize-observer";
const ignoreCircularReferences = () => {
const seen = new WeakSet();
return (key: string, value: Record<string, unknown>) => {
if (key.startsWith("_")) return;
if (typeof value === "object" && value !== null) {
if (seen.has(value)) return;
import * as dotenv from 'dotenv'
import * as fs from 'fs'
export class ConfigService {
private readonly envConfig: { [key: string]: string }
constructor(mode: 'development' | 'production') {
this.envConfig = dotenv.parse(fs.readFileSync(`${mode}.env`))
}
export type TConfigMode = 'development' | 'production'