Skip to content

Instantly share code, notes, and snippets.

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

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

๐Ÿ’ญ
๐—Ÿ๐—ข๐—ข๐—ž๐—œ๐—ก๐—š ๐—™๐—ข๐—ฅ ๐—ก๐—˜๐—ช ๐—ข๐—ฃ๐—ฃ๐—ข๐—ฅ๐—ง๐—จ๐—ก๐—œ๐—ง๐—œ๐—˜๐—ฆ.
View GitHub Profile
@montasim
montasim / puppeteer-auto-reloader.js
Created June 26, 2024 06:53
This script automatically refreshes a given webpage at specified intervals using Puppeteer. It is designed to monitor changes on a webpage over time. This version includes better error handling and resource management to ensure the script runs efficiently.
/**
* @file This script automatically refreshes a given webpage at specified intervals using Puppeteer.
* It is designed to monitor changes on a webpage over time. This version includes better error handling
* and resource management to ensure the script runs efficiently.
*/
const puppeteer = require('puppeteer');
let browser;
const refreshUrl = 'https://profile-counter.glitch.me/montasim/count.svg';
@montasim
montasim / terser.js
Last active June 27, 2024 17:30
This script processes files by minifying JavaScript files using Terser and copying other file types. It reads configurations from a build.json, respects ignore patterns, and logs the process summary while tracking file sizes. This script is intended to be part of a build process, ensuring that only necessary files are included in the output direโ€ฆ
/**
* @fileoverview This script processes files by minifying JavaScript files using Terser and copying other file types.
* It reads configurations from a build.json, respects ignore patterns, and logs the process summary while tracking file sizes.
* This script is intended to be part of a build process, ensuring that only necessary files are included in the output directory
* and that JavaScript files are optimized for production.
*/
import fs from 'fs/promises';
import path from 'path';
import { globSync } from 'glob';
@montasim
montasim / SECURITY.md
Last active August 13, 2024 17:28
this SECURITY.md file is an essential part of the security posture for the service, ensuring that all stakeholders are informed and engaged in maintaining the security and integrity of the system.

SECURITY POLICY

We are committed to ensuring the security of our users and prioritize the confidentiality, integrity, and availability of our systems and services. This document provides guidelines on how to report security vulnerabilities and outlines our response process.


Table of Contents

@montasim
montasim / vercel.json
Created June 24, 2024 17:12
Sample JSON for deploying a project to Vercel.
{
"version": 2,
"builds": [
{
"src": "./src/server.js",
"use": "@vercel/node"
}
],
"routes": [
{
@montasim
montasim / http-status-codes.js
Last active January 28, 2025 08:13
Defines common HTTP status codes for use in API responses. These status codes represent various states of HTTP responses and are commonly used to communicate the result of API requests. Adjust these codes as needed to align with the APIs response requirements.
/**
* @fileoverview Defines common HTTP status codes for use in API responses.
* These status codes represent various states of HTTP responses and are
* commonly used to communicate the result of API requests.
* Adjust these codes as needed to align with the API's response requirements.
*
* @module constants/httpStatus
* @version 1.0.0
* @license CC BY-NC-ND 4.0
*
@montasim
montasim / mime-types.js
Last active January 28, 2025 08:29
Defines common MIME types for use in API responses. These MIME types represent various types of content that can be served by the API. Adjust these MIME types as needed to align with the APIs content requirements.
/**
* @fileoverview Defines the various MIME types used in the application.
* This module exports an object that contains the different MIME types
* the application can handle. These MIME types are used to identify the format of data being processed or served.
*
* @module constants/mimeTypes
* @version 1.0.0
* @license CC BY-NC-ND 4.0
*
* @contact Mohammad Montasim-Al-Mamun Shuvo
@montasim
montasim / file-extensions.js
Last active June 27, 2024 17:34
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 APIs 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 APIs content requirements.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-03-03
*/
/**

Project Name

Project Sample Gif


Requirements to Run the Project

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@montasim
montasim / loadingSpinner.js
Last active May 21, 2024 07:57
Custom Loading Spinner with SweetAlert2 and Tailwind CSS
const show = (
text = 'Please wait, the system is preparing necessary data.'
) => {
Swal.fire({
width: '550px',
html: `
<div class="bg-transparent flex flex-col items-center justify-center gap-4">
<img class="w-20" src="../media/gifs/lightBlueLoadingSpinner.gif" alt="Loading gif">
<strong>${text}</strong>