Skip to content

Instantly share code, notes, and snippets.

View m3h3d1ha2an's full-sized avatar
💪
A servant of the Almighty, building with intention.

Mehedi Hasan m3h3d1ha2an

💪
A servant of the Almighty, building with intention.
View GitHub Profile
@m3h3d1ha2an
m3h3d1ha2an / best_frontend_framework_2026.md
Created January 12, 2026 06:39
Best Frontend Framework in Javascript/Typescript ecosystem according to X (ex twitter ) Servey with grok in 2026

According to discussions and trends on X (Twitter) and recent web sources in early 2026, for building small-scale TypeScript sites like landing pages, portfolio pages, company/agency/organization sites (2-3 pages), and especially those with a blog, the community strongly leans toward performance-first, content-oriented meta-frameworks.

The top contenders are Astro (often praised as the winner for this exact use case), Next.js (still the safe, versatile default), and SvelteKit (for joyful DX and tiny bundles). Remix appears less frequently for purely content/marketing sites.

Here's a breakdown focused on your needs (landing/portfolio + blog), including DX (developer experience), UX (end-user experience via speed/responsiveness), and SEO:

1. Astro (Strongest Recommendation for Your Use Case)

Astro dominates 2025–2026 discussions for content-heavy, mostly static sites like portfolios, marketing/landing pages, company sites, and blogs.

  • *Why it fits perfectly
  1. What causes a React component to re-render? ( একটি React কম্পোনেন্ট কেন রি-রেন্ডার হয়? )

Answer: A React component generally re-renders when its state, props, or parent changes, though specialized triggers like Context updates or key changes can also cause it. (সাধারণত একটি React কম্পোনেন্টের state, props, অথবা parent পরিবর্তন হলে এটি রি-রেন্ডার হয়, তবে Context update বা key পরিবর্তনের মতো কিছু বিশেষ কারণেও এটি হতে পারে।)

import { useState } from "react";

export const ReRenderExample = () => {
  const [count, setCount] = useState(0);

  return (
    <div>
<?php
<!-- input from anywhere (browser, mobile app, postman, etc) -->
<!-- /api/v1/blogs/42/comments/7?sort=desc&limit=5&include=author,tags -->

<!-- output -->
 <!-- {
  "full_url": "/api/v1/blogs/42/comments/7?sort=desc&limit=5&include=author,tags",
  "path_segments": ["api", "v1", "blogs", "42", "comments", "7"],
  "resource": "blogs",

নিশ্চয়! যেহেতু আপনি PHP এবং REST API style URL handling নিয়ে কাজ করছেন, আমি আপনাকে ৫টি প্র্যাকটিস টাস্ক দিচ্ছি যা real-world API parsing ও PHP array/json handling-এ সাহায্য করবে।


1. Dynamic Resource Extraction

Task: একটি URL string নিয়ে লিখুন যে function:

  • সব resource এবং sub-resource কে dynamically array আকারে বের করবে।
@m3h3d1ha2an
m3h3d1ha2an / how to have zero mege commits with git.md
Last active May 20, 2025 08:00
If you want zero merge commits and a perfectly linear history, here's your git workflow scenario ( example , main is release branch, and dev is developerment)

1. Make Sure Everything Is Up to Date

git switch dev
git pull origin dev
git switch main
git pull origin main

2. Rebase dev onto main

This puts all your dev commits “on top of” main, making the history linear and avoiding merge commits.

A Modern Way to Create a Dialog or Modal Without JavaScript (Pure HTML and CSS Only) in 2025

This example demonstrates how to build a fully functional dialog/modal using only HTML and CSS.

HTML Structure

<!-- HTML Structure for the Dialog -->
<input type="checkbox" id="dialog-toggle" class="hidden">
<label for="dialog-toggle" class="dialog-open">Open</label>
<div class="dialog-backdrop">
@m3h3d1ha2an
m3h3d1ha2an / solution.md
Last active April 10, 2025 07:02
browser-external:events:9 Module "events" has been externalized for browser compatibility. Cannot access "events.EventEmitter" in client code. See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
@m3h3d1ha2an
m3h3d1ha2an / postgresql_plus_arch-linux.md
Created March 14, 2025 00:02 — forked from NickMcSweeney/postgresql_plus_arch-linux.md
Getting postgresql running on Arch Linux

Setup Postgresql

run postgresql with systemctl

Install postgres

latest

sudo pacman -S postgresql

specific version

find version & build from source

@m3h3d1ha2an
m3h3d1ha2an / property-user-does-not-exist-on-type-requestparamsdictionary-any-any-parsedqs-recordstring-any.md
Last active March 30, 2025 23:44
Problem: Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'

Problem: Property 'user' does not exist on type 'Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>'

When working with Express and jsonwebtoken, it's better to use res.locals to store user-related data rather than modifying the req object directly. This approach adheres to best practices and avoids potential issues with modifying the req object.

Here’s why:

  1. Separation of Concerns: res.locals is designed for passing data to subsequent middleware or templates. It keeps the request object clean and unmodified.
  2. Middleware-Safe: Using res.locals ensures that the data is available to other middleware without interfering with the original request object.

Instead of: