Skip to content

Instantly share code, notes, and snippets.

View montasim's full-sized avatar
๐Ÿ’ญ
๐—Ÿ๐—ข๐—ข๐—ž๐—œ๐—ก๐—š ๐—™๐—ข๐—ฅ ๐—ก๐—˜๐—ช ๐—ข๐—ฃ๐—ฃ๐—ข๐—ฅ๐—ง๐—จ๐—ก๐—œ๐—ง๐—œ๐—˜๐—ฆ.

๏ผญโ™ข๏ผฎ๏ผดฮ›๏ผณ๏ผฉ๏ผญ montasim

๐Ÿ’ญ
๐—Ÿ๐—ข๐—ข๐—ž๐—œ๐—ก๐—š ๐—™๐—ข๐—ฅ ๐—ก๐—˜๐—ช ๐—ข๐—ฃ๐—ฃ๐—ข๐—ฅ๐—ง๐—จ๐—ก๐—œ๐—ง๐—œ๐—˜๐—ฆ.
View GitHub Profile
@montasim
montasim / .prettierrc
Created July 6, 2024 14:20
Using a .prettierrc file in your project ensures that everyone contributing to the codebase follows the same formatting rules. This eliminates discussions over style in code review, saves time, and reduces inconsistencies that can lead to errors. It can also make it easier for new developers to adhere to project standards from the outset. Prettiโ€ฆ
{
"semi": true,
"singleQuote": true,
"arrowParens": "always",
"trailingComma": "es5",
"bracketSpacing": true,
"tabWidth": 4,
"useTabs": false,
"endOfLine": "crlf",
"overrides": [
@montasim
montasim / .prettierignore
Last active April 8, 2025 10:02
Ignoring these files and directories ensures that Prettier only formats the code files you actively develop and maintain, such as .js, .jsx, .ts, .tsx, .css, .html, etc. This helps maintain the integrity and readability of configuration files and directories that either contain generated code, package dependencies, or configuration settings thatโ€ฆ
####################################################
# .prettierignore Configuration File
####################################################
#
# Version: 1.0.0
# License: CC BY-NC-ND 4.0
#
# Author: Mohammad Montasim-Al-Mamun Shuvo
# Created: 2025-01-28
# Contact Email: [email protected]
@montasim
montasim / .gitattributes
Last active August 8, 2024 17:14
Using a .gitattributes file improves the robustness of a codebase by ensuring that all contributors adhere to defined file handling conventions, regardless of their personal Git configurations or operating systems. This leads to fewer merge conflicts and issues related to improper file handling, and it makes the repository more stable and easierโ€ฆ
####################################################
# .gitattributes Configuration File
####################################################
# This configuration file is used by Git to handle the line endings and encoding settings for files based on their type.
# It ensures consistent handling of files across different operating systems and environments.
####################################################
# DEFAULT BEHAVIOR
# Purpose: Defines the default text handling behavior for files when committing and checking out.
# Use: Ensures automatic normalization of line endings.
@montasim
montasim / .editorconfig
Last active December 25, 2024 17:43
The purpose of this .editorconfig file is to ensure that all contributors to your project adhere to specified coding and styling standards automatically, minimizing the formatting discrepancies that can occur when different developers with different editing environments work on the same project. This leads to cleaner, more readable code that looโ€ฆ
####################################################
# .editorconfig Configuration File
####################################################
# EditorConfig is awesome: https://EditorConfig.org
# This configuration enables consistent coding styles between various
# text editors and IDEs. By specifying formatting properties based
# on file types, it helps maintain a standard code style for teams
# or individual developers. The rules here act as a guide for
# better readability and maintainability of codebases.
@montasim
montasim / README.md
Last active August 15, 2024 05:47
Sample README.md file

LIBRARY MANAGEMENT SYSTEM SERVER

Wakatime coding time badge GitHub last commit GitHub commit activity
@montasim
montasim / authenticate.middleware.js
Created July 4, 2024 14:25
This module defines middleware for authenticating users based on JSON Web Tokens (JWT). It checks for a valid token in the Authorization header, validates it, and retrieves the user details. If the token is valid and the user exists, it allows the request to proceed. If any validation fails, it returns an appropriate HTTP status code and error mโ€ฆ
import getAuthenticationToken from '../utilities/getAuthenticationToken.js';
import httpStatus from '../constant/httpStatus.constants.js';
import decodeAuthenticationToken
from '../utilities/decodeAuthenticationToken.js';
import UsersModel from '../modules/api/users/users.model.js';
const authenticateMiddleware = async (req, res, next) => {
const token = await getAuthenticationToken(req?.headers['authorization']);
if (!token) {
@montasim
montasim / file-extensions.js
Created July 1, 2024 08:14
Defines common file extension types for use in API responses. These file extension types represent various types of files that can be served by the API. Adjust these file extension types as needed to align with the API's content requirements.
/**
* @fileoverview Defines common file extension types for use in API responses.
* These file extension types represent various types of files that can be served by the API.
* Adjust these file extension types as needed to align with the API's content requirements.
*
* This structured approach using an object makes it easy to add, remove or access file types.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-03-03
*/
@montasim
montasim / CONTRIBUTION.md
Last active August 13, 2024 17:28
Sample CONTRIBUTION.md file.
@montasim
montasim / eslint.config.mjs
Created June 27, 2024 18:39
This configuration file sets up linting rules and environments for a JavaScript project. It includes settings for ECMAScript 2020 features, enforces coding styles, and configures plugins for additional linting capabilities.
export default {
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 2020, // Updated for more ES6+ features
sourceType: 'module',
globals: {
jest: 'readonly',
},
},
linterOptions: {
@montasim
montasim / node-error-codes.js
Last active June 27, 2024 17:32
Defines common Node.js system error codes for handling system-level errors. These error codes are used by the Node.js API in response to operations like file access, network requests, and subprocess management. This module centralizes error codes to improve error handling practices across the application.
/**
* @fileoverview Defines common Node.js system error codes for handling system-level errors.
* These error codes are used by the Node.js API in response to operations like file access,
* network requests, and subprocess management. This module centralizes error codes to improve
* error handling practices across the application.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-06-27
*/