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 / gensecret.md
Created March 4, 2025 15:10
JWT Secret Generator With NodeJS One Line command
node -e "console.log(require('crypto').randomBytes(64).toString('hex'))" | wl-copy
@m3h3d1ha2an
m3h3d1ha2an / .zshrc
Created February 20, 2025 02:17 — forked from unyo/.zshrc
.zshrc with fnm
# fnm
eval "$(fnm env)"
# add fnm autocomplete
fnm completions --shell=zsh > ~/.config/zsh/completions/_fnm # you can run this once and then comment out
fpath+=~/.config/zsh/completions/_fnm
autoload -U compinit
compinit
# autoload .nvmrc
@m3h3d1ha2an
m3h3d1ha2an / visualize-react-renders.md
Last active January 27, 2025 14:00
Add the following link to your index.html of react codebase to see renders on project ui in browser
<script src="https://unpkg.com/react-scan/dist/auto.global.js"></script>
@m3h3d1ha2an
m3h3d1ha2an / cors-in-depth-the-last-word-for-web-developers.md
Created December 24, 2024 09:25
What is CORS? - Cross-Origin Resource Sharing Explained

CORS in Depth: The Last Word for Web Developers

By now, every web developer has heard of Cross-Origin Resource Sharing-or CORS for short-but few actually understand it. In this post, we attempt to explain CORS from the very ground zero up to the most common pitfalls and the best practices using the technology. Be it an experienced developer or a candidate aiming to ace your software engineering interview; this article will equip you with the knowledge needed to handle CORS.

What is CORS?   The Same-Origin Policy  Before explaining CORS, there is a need to have an understanding of the Same-Origin Policy. The Same-Origin Policy is a security policy implemented in all web browsers. It confines how resources from one origin interact with resources from another. An origin is defined as the combination of:  Protocol, for example - https://  Domain, for example - example.com  Port, for example - :3000

@m3h3d1ha2an
m3h3d1ha2an / medium.css
Created November 23, 2024 07:36
Compact typography for the web
@import url('https://fonts.googleapis.com/css?family=Lato:400,700|Lora|Playfair+Display:700i,900');
html,
body {
margin: 0;
width: 100%;
}
h1,
h2,
@m3h3d1ha2an
m3h3d1ha2an / ripple.min.css
Created November 23, 2024 06:35
Pure CSS implementation of Android Material design "ripple" animation
.ripple{position:relative;overflow:hidden;transform:translate3d(0,0,0)}.ripple:after{content:"";display:block;position:absolute;width:100%;height:100%;top:0;left:0;pointer-events:none;background-image:radial-gradient(circle,#000 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:scale(10,10);opacity:0;transition:transform .5s,opacity 1s}.ripple:active:after{transform:scale(0,0);opacity:.2;transition:0s}
@m3h3d1ha2an
m3h3d1ha2an / windows-keys.md
Created October 26, 2024 11:49 — forked from rvrsh3ll/windows-keys.md
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

@m3h3d1ha2an
m3h3d1ha2an / file-name-differs-from-already-included-file-name-only-in-casing.md
Created June 27, 2024 05:38
'File name differs from already included file name only in casing' on relative path with same casing

You need to disable the forceConsistentCasingInFileNames in the tsconfig.json file.

So you should have something like that:

{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": false,
  }
}
@m3h3d1ha2an
m3h3d1ha2an / typeerror-cannot-read-properties-of-undefined-reading-headerssent.md
Last active June 25, 2024 11:34
TypeError: Cannot read properties of undefined (reading 'headersSent')

it wasn't a problem with Express, but an issue with my coding style. Because I don't use semicolons the error ocurred.

app.use(...)

(async () => {
   ...
})()