Skip to content

Instantly share code, notes, and snippets.

View baliyan9887's full-sized avatar
💪

Gautam Kumar baliyan9887

💪
View GitHub Profile
@baliyan9887
baliyan9887 / jsconfig.json
Last active January 26, 2024 09:37
This configuration file is designed to enhance the development experience in a JavaScript project. It leverages JavaScript Compiler Options for better code organization, readability, and maintainability.
{
// JavaScript compiler options
"compilerOptions": {
// Set the base URL for all relative module imports.
// This helps in having cleaner and shorter import paths.
"baseUrl": ".",
// Define path aliases for commonly used directories.
// This improves the readability of import statements.
"paths": {
@baliyan9887
baliyan9887 / tsconfig.json
Created January 26, 2024 10:54
Optimize your TypeScript development workflow by leveraging advanced configurations and path aliases. This Gist provides a comprehensive jsconfig.json setup, enhancing import paths for better code readability and maintainability. Say goodbye to complex relative imports!
{
"compilerOptions": {
// Set the base URL for all relative module imports
"baseUrl": ".",
// Define path aliases for shorter and cleaner imports
"paths": {
"@src/*": ["src/*"],
"@components/*": ["src/components/*"],
"@utils/*": ["src/utils/*"],
@baliyan9887
baliyan9887 / arrayUtils.js
Created January 26, 2024 11:04
A collection of generic functions for common array manipulations in JavaScript. These functions provide utility for tasks like pushing, popping, sorting, filtering, mapping, and more.
// 1. Push an Item to the Array
function pushItem(arr, item) {
arr.push(item);
}
// 2. Pop an Item from the Array
function popItem(arr) {
arr.pop();
}
@baliyan9887
baliyan9887 / reactCondtionalRendering.tsx
Last active March 15, 2024 21:28
React Conditional Rendering Context
import React, { createContext, useContext, ReactNode, useMemo } from 'react';
/**
* Props for conditional rendering components.
*/
interface ConditionalProps {
children: ReactNode;
}
/**