Skip to content

Instantly share code, notes, and snippets.

View nurmdrafi's full-sized avatar
:octocat:
Focusing

Nur Mohamod Rafi nurmdrafi

:octocat:
Focusing
View GitHub Profile
@nurmdrafi
nurmdrafi / setup.md
Last active November 10, 2025 11:25
Setting Up ESLint v9, Prettier, Git Hooks & Code Quality Tools
@nurmdrafi
nurmdrafi / workflow.md
Last active November 6, 2025 09:07
CI/CD Workflow Guide: Multi-Architecture Docker Builds

CI/CD Workflow Guide: Multi-Architecture Docker Builds

This guide explains how to implement and maintain CI/CD workflows for building and deploying multi-architecture Docker images with optimized caching strategies.

Overview

Multi-architecture Docker workflow supporting AMD64 + ARM64 builds with:

  • GitHub Actions caching: Simple, optimized caching for GHA environment
  • Docker Build Cloud for ARM64 only: Cloud builders used exclusively for ARM64 builds for speed
  • AMD64 native builds: Standard GitHub runners for AMD64 builds
@nurmdrafi
nurmdrafi / EsLint migrate to v9.md
Created September 10, 2025 08:45
EsLint migrate to v9

Modernizing Your JavaScript/TypeScript Workflow: ESLint v9, Prettier, and lint-staged

In modern web development, maintaining code quality and consistency is paramount. This article outlines how to migrate to the latest ESLint v9, integrate Prettier for code formatting, and leverage lint-staged to automate these checks before each commit. We'll assume you already have Husky set up for Git hooks.

Prerequisites

  • Node.js (>=22.4.1)
  • npm or yarn
  • Git
  • Husky (already installed)
Metric With Next.js Image With CDN + img tag Improvement
First Contentful Paint 2.1s 1.3s 38% faster
Largest Contentful Paint 4.2s 1.8s 57% faster
Cumulative Layout Shift 0.15 0.05 67% better
Build Time 12 minutes 4 minutes 67% faster
Image Load Success Rate 87% 99% 12% better
@nurmdrafi
nurmdrafi / cursor.md
Created April 9, 2025 14:59
Install Cursor AI editor on Ubuntu 24.04

Install Cursor AI editor on Ubuntu 24.04

  1. Use the Download button on www.cursor.com web site. It will download the NAME.AppImage file.

  2. Move the File:

sudo mv ~/Downloads/NAME.AppImage /opt/cursor.appimage
@nurmdrafi
nurmdrafi / prompts.md
Last active March 26, 2025 20:19
Unit Test Prompts

Vitest setup

MOCK SETUP CONFIGURATION WORKFLOW

PHASE 1: PROJECT STRUCTURE ANALYSIS
1. Redux: Located in redux/, with feature-specific logic in redux/features/
2. API Responses: Used in pages/ and hooks/
3. LocalStorage/SecureLocalStorage: Used in utils/ or directly in components
4. Tests: Stored in __tests__/ with mocks designed for testing
@nurmdrafi
nurmdrafi / template.md
Created March 3, 2025 15:45
Folder Structure
src/
β”œβ”€β”€ app/                          # Next.js app router
β”‚   β”œβ”€β”€ (marketing)/              # Public pages (e.g., home, about)
β”‚   β”œβ”€β”€ (shop)/                   # Shop-related pages
β”‚   β”œβ”€β”€ (product)/                # Product-related pages
β”‚   β”œβ”€β”€ (admin)/                  # Admin-related pages
β”‚   β”œβ”€β”€ layout.tsx                # Root layout
β”‚   └── page.tsx                  # Home page
β”œβ”€β”€ components/                   # Reusable components
@nurmdrafi
nurmdrafi / template.md
Last active January 26, 2025 15:14
Frontend Documentation Template

[Project Title]

1. Project Overview

Description

Insert a brief and concise description of the project. For example: "A web application for [briefly state the main purpose, e.g., tracking expenses, managing tasks, creating a portfolio]."

Purpose

@nurmdrafi
nurmdrafi / cmd.md
Last active March 3, 2025 08:55
Terminal Config

Bash

# Enable the subsequent settings only in interactive sessions
case $- in
  *i*) ;;
    *) return;;
esac

# Path to your oh-my-bash installation.
export OSH='/home/nurmdrafi/.oh-my-bash'