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 / 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'

tsconfig.json

{
  "compilerOptions": {
    "typeRoots": ["node_modules/@types"],
    "baseUrl": ".",
    "paths": {
      "@components/*": ["components/*"],
      "@hooks/*": ["hooks/*"],
 "@features/*": ["redux/features/*"],
@nurmdrafi
nurmdrafi / shadcn.config.md
Last active November 14, 2024 11:17
typescript eslint config for shadcn UI

tsconfig.json

{
{
	"compilerOptions": {
		"target": "es2022",
		"lib": ["dom", "dom.iterable", "esnext"],
		"allowJs": true,
		"skipLibCheck": true,
@nurmdrafi
nurmdrafi / package.md
Last active February 18, 2025 19:48
How to Build and Publish NPM Package Using Rollup, Babel, TypeScript, ESLint, and Jest

πŸš€ How to Build and Publish NPM Package Using Rollup, Babel, TypeScript, ESLint, and Jest

1. Setup the Project

Create a new directory for your project and initialize it with npm:

mkdir my-package
cd my-package
npm init -y
@nurmdrafi
nurmdrafi / Update docker image tags with dynamic version.md
Last active July 9, 2024 11:15
Update docker image tags with dynamic version
name: Docker Image CI/CD for Staging

on:
  push:
    branches: ["staging"]

env: 
  DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
  DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}