Skip to content

Instantly share code, notes, and snippets.

View montasim's full-sized avatar
💭
𝗟𝗢𝗢𝗞𝗜𝗡𝗚 𝗙𝗢𝗥 𝗡𝗘𝗪 𝗢𝗣𝗣𝗢𝗥𝗧𝗨𝗡𝗜𝗧𝗜𝗘𝗦.

M♢NTΛSIM montasim

💭
𝗟𝗢𝗢𝗞𝗜𝗡𝗚 𝗙𝗢𝗥 𝗡𝗘𝗪 𝗢𝗣𝗣𝗢𝗥𝗧𝗨𝗡𝗜𝗧𝗜𝗘𝗦.
View GitHub Profile
@montasim
montasim / CONTRIBUTING.md
Created June 27, 2024 18:55
Sample CONTRIBUTING.md file.

Contributing

First off, thank you so much for taking the time to contribute. All contributions are more than welcome!

How can I contribute?

If you have an awesome new feature that you want to implement, or you found a bug that you would like to fix, here are some instructions to guide you through the process:

  • Create an issue to explain and discuss the details
  • Fork the repo
@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
*/
@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 / repository-summary-badges.md
Last active June 27, 2024 17:32
Commonly used badges for a repository.
GitHub forks GitHub Repo stars GitHub watchers build update badge language badge top language badge GitHub code size in bytes
@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
Created June 25, 2024 14:10
Security template for GitHub project.

Security Policy

Reporting a Vulnerability

If you discover a security vulnerability in service, please do the following:

  • Do not create a public issue or pull request, as this could expose the vulnerability to malicious actors.

  • Instead, please email me at montasimmamun@gmail.com with details of the vulnerability and steps to reproduce it. Please include the following information in your report:

  • A description of the vulnerability and how it can be exploited

@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 June 27, 2024 17:33
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 APIs response requirements.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-03-03
*/
@montasim
montasim / mime-types.js
Last active June 27, 2024 17:33
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 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.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-03-03
*/
/**