Skip to content

Instantly share code, notes, and snippets.

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

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

๐Ÿ’ญ
๐—Ÿ๐—ข๐—ข๐—ž๐—œ๐—ก๐—š ๐—™๐—ข๐—ฅ ๐—ก๐—˜๐—ช ๐—ข๐—ฃ๐—ฃ๐—ข๐—ฅ๐—ง๐—จ๐—ก๐—œ๐—ง๐—œ๐—˜๐—ฆ.
View GitHub Profile
@montasim
montasim / addUseStrict.js
Last active December 26, 2024 12:15
Adds the 'use strict'; directive to the top of a JavaScript file if it's not already there.
'use strict';
import fs from 'fs';
import path from 'path';
/**
* Represents the file system path to the 'shared' directory.
* The path is constructed by resolving the current working directory and appending 'shared' to it.
* It can be used to reference or access files and sub-directories located within the 'shared' directory.
*

CONTRIBUTOR LICENSE AGREEMENT (CLA)

Thank you for your interest in contributing to our project! To ensure that our project remains sustainable and that contributions can be integrated smoothly, we require all contributors to agree to the following Contributor License Agreement ("Agreement"). This Agreement helps us maintain the quality and integrity of the project while respecting your rights as a contributor.


Table of Contents

@montasim
montasim / generate-project-structure.js
Last active May 7, 2025 06:59
Recursively generates a tree structure of the directory.
import fs from 'fs';
import path from 'path';
// Configuration
const IGNORE_LIST = ['.git', 'node_modules', 'log']; // Add more if needed
const OUTPUT_FILE = 'structure.md';
/**
* Recursively generates a tree structure of the directory.
*
import errorResponse from '../utilities/errorResponse.js';
import httpStatus from '../constant/httpStatus.constants.js';
import sendResponse from '../utilities/sendResponse.js';
import loggerService from '../service/logger.service.js';
import toSentenceCase from '../utilities/toSentenceCase.js';
const getResourceById = async (model, populateMethod, resourceId, resourceType) => {
try {
const resource = await populateMethod(model.findById(resourceId));
if (!resource) {
import { Schema } from 'mongoose';
import constants from '../constant/constants.js';
import userConstants from '../modules/api/users/users.constants.js';
import patterns from '../constant/patterns.constants.js';
// Define the shared username schema
const usernameSchema = {
type: String,
trim: true,
import asyncErrorHandlerService from '../utilities/asyncErrorHandler.js';
import getRequesterId from '../utilities/getRequesterId.js';
import loggerService from '../service/logger.service.js';
import getHostData from '../utilities/getHostData.js';
import getRequestedDeviceDetails from '../utilities/getRequestedDeviceDetails.js';
// TODO: Implement the `entity` log
// TODO: utilize the hostData for every entity
const createNewUserEntity = (service, createFunction) =>
import NodeCache from 'node-cache';
import loggerService from '../service/logger.service.js';
const cache = new NodeCache();
const create = (duration = 3600) => {
return (req, res, next) => {
let key;
@montasim
montasim / List of common passwords
Last active July 29, 2024 07:11
๐Ÿ” This gist provides a curated list of commonly used passwords, compiled to assist developers, security professionals, and enthusiasts in understanding common security vulnerabilities associated with weak password practices. Useful for educational purposes, penetration testing, and security training. Note: Do not use these passwords for personalโ€ฆ
123456
password
12345678
qwerty
123456789
12345
1234
111111
1234567
dragon
@montasim
montasim / List of temporary email domains
Last active July 29, 2024 07:18
๐Ÿ“ง This gist contains a comprehensive list of domains used by temporary email services. It's intended to help developers and security analysts filter out or monitor temporary email addresses in their applications, enhancing security measures and maintaining the integrity of user data. Ideal for use in signup processes, form validations, and anywhโ€ฆ
0-mail.com
027168.com
0815.ru
0815.ry
0815.su
0845.ru
0box.eu
0clickemail.com
0n0ff.net
0nelce.com
@montasim
montasim / .prettierignore
Last active July 16, 2024 09:03
This file specifies patterns of files and directories that Prettier should ignore.
####################################################
# Prettier Ignore Configuration File
####################################################
# This file specifies patterns of files and directories that Prettier should ignore.
# Using this file helps avoid formatting conflicts and unnecessary processing of files not meant for modification.
####################################################
# IDE and Project Files
# Purpose: Prevent Prettier from formatting project and IDE configuration files.
# Use: Ensures that configurations and settings files are not altered unintentionally.