Skip to content

Instantly share code, notes, and snippets.

View MuhammadQuran17's full-sized avatar

Muhammad Umar MuhammadQuran17

  • DanAds
View GitHub Profile
@MuhammadQuran17
MuhammadQuran17 / linux_helper.md
Last active January 14, 2025 05:26
Linux helper

How to create SSH key (in terminal $):

$ ssh-keygen -b 2048 -t rsa -C "your.email@company.com"

Start service automatically on every boot (start computer)

sudo systemctl enable [service_name]

Extract tar into executable

sudo tar -xvzf ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin/

@MuhammadQuran17
MuhammadQuran17 / js_doc.md
Last active March 18, 2026 07:44
Js helpers
Aspect Promise.all Promise.allSettled
Rejects on first failure Yes, stops everything No, waits for all
Result on success Array of values Array of {status: "fulfilled", value: ...}
Result on mixed Rejects with first error Array with fulfilled/rejected statuses
Use case All must succeed (e.g., required API calls) Inspect all outcomes (e.g., optional fetches)

Promise.all rejects immediately if any promise rejects, returning only successful values if all succeed.
Promise.allSettled always resolves after all promises settle (fulfill or reject), providing status for each

@MuhammadQuran17
MuhammadQuran17 / css_talwind.md
Last active October 14, 2025 05:35
css_talwind.md

Css

Css style hirearchy

  1. !important: A special flag that overrides all other rules.
  2. Inline Styles: Styles written directly on the element (e.g., <a style="color: red;">).
  3. ID Selectors: Rules targeting an ID (e.g., #main-button).
  4. Class Selectors, Attribute Selectors, and Pseudo-classes: Rules targeting a class (.button-primary), an attribute ([target="_blank"]), or a state (:hover).
  5. Type Selectors and Pseudo-elements: Rules targeting an HTML tag itself (e.g., a, p, div) or a pseudo-element (::before).
@MuhammadQuran17
MuhammadQuran17 / database_knowledgebase.md
Last active December 7, 2025 17:11
Database theory

Transactions

MySQL

Only the part that fails will fail — previous successful statements will NOT be rolled back automatically.

Long answer with full explanation below ⬇️


@MuhammadQuran17
MuhammadQuran17 / Versioning.md
Last active February 21, 2025 06:46
Packages Versioning in composer.json, PHP

There is a difference between ~ and ^ in Composer, though it might not be immediately obvious in some cases. Let me clarify:

Key Difference Between ~ and ^:

  • ~ (tilde): Allows updates for the last digit specified.
  • ^ (caret): Allows updates for all minor versions within the same major version.

In your example, ~7.3 vs. ^7.3:

  • ~7.3:
@MuhammadQuran17
MuhammadQuran17 / intellijHelper.md
Last active October 29, 2025 13:07
Intellij IDEA helper

Index stuck forever

  1. Remove files inside of this folder C:\Users\muham\AppData\Local\JetBrains\PhpStorm2024.2\caches
  2. You can use PowerShell CLI for this (if you in PhpStormXXXX): Remove-Item .\caches\* -Recurse -Force
  3. Remove .idea folder
  4. Alternative is using File/InvalidateCaches button, but if it stuck, you should end task in taskManager and do 1,2 steps

ALL neccessary info here

@MuhammadQuran17
MuhammadQuran17 / git.md
Last active December 24, 2025 14:09
Git helper

Git clone private repository

  1. Create a grained PAT in github. Notice that grained PAT, can not see repos where you are not the owner, i.e. colloborator.
  2. Add Rules for your grained PAT. Permissions: Commit statuses, Contents, Pull requests and Metadata as Read to be able to Clone repositories. And the same Permissions need to the Read and Write to be able to push changes.
  3. git config --global user.name "Your Name"
  4. git config --global user.email "your.email@example.com"
  5. git config --list
  6. git clone https://(USERNAME):(TOKEN)@github.com/OWNER/REPO.git

Undo merged Merge request

@MuhammadQuran17
MuhammadQuran17 / docker.md
Last active March 13, 2026 10:15
Docker helper

Importants

You can't COPY a file from outside the build context. So if you are 
trying to COPY /opt/venv/lib/python3.7/site-packages/xxx/resources/abc.py into your docker image, and 
that is not in your build context, it will fail. Full stop.

docker inspect coolify-proxy -f '{{ json .Config }}' | jq

Entrypoint

@MuhammadQuran17
MuhammadQuran17 / Php_xmsi.md
Last active February 27, 2026 07:15
Code sheat

Update php in VPS

sudo apt install -y \
php8.3 \
php8.3-cli \
php8.3-common \
php8.3-mysql \
php8.3-xml \