Skip to content

Instantly share code, notes, and snippets.

View MuhammadQuran17's full-sized avatar

Muhammad Umar MuhammadQuran17

  • DanAds
View GitHub Profile
@MuhammadQuran17
MuhammadQuran17 / vue.md
Last active December 3, 2025 05:15
Vue cheatsheet

Author: Gemini

Think of it like this:

Imagine building a Lego car. You have all the different bricks and pieces put together to form the car. Serialization is like taking that Lego car apart and putting all the bricks into a box. You can then ship that box to someone else, and they can use the instructions (the serialization format) to rebuild the exact same car from the bricks.

Common uses of serialization

Saving objects to files: You can serialize objects and save them to files on your hard drive, allowing you to load them back into your program later. Sending objects over a network: Serialization is essential for sending objects between different computers or applications, such as in web services or distributed systems.

@MuhammadQuran17
MuhammadQuran17 / debounce_xmsi.md
Created January 1, 2025 15:06
debounce for API limits

Debounce

Author: GPT-4o

Lodash's debounce function is used to limit how often a function is executed over time, even if it's called frequently. It's particularly helpful when you want to avoid unnecessarily calling a function multiple times in quick succession. This is especially useful for improving performance and user experience.

Example Scenario: Searching While Typing

Imagine you have a search bar where users type a query, and for each keystroke, a search request is sent to a server. If a user types "hello," five separate requests would be sent: one for "h," another for "he," then "hel," "hell," and "hello." This can overload the server and create lag.

@MuhammadQuran17
MuhammadQuran17 / repository_strategy_xmsi.md
Last active November 1, 2025 18:23
Repository and Strategy Patterns

Author: GPT-4o

In Laravel, Service Pattern and Repository Pattern are two common design patterns used to structure the business logic and data layer. Each pattern has its purpose and responsibilities, and they can even complement each other.

1. Service Pattern

The Service Pattern is used to encapsulate business logic, making it reusable and independent of the controller or other layers. This is where you place the "what needs to be done" logic, such as calculations, complex workflows, or coordination of multiple repositories or APIs.

Key Characteristics:

  • Focuses on business logic.
  • Keeps controllers thin by moving complex logic out.
@MuhammadQuran17
MuhammadQuran17 / devops_xmsi.md
Last active January 27, 2026 09:49
DNS, Devops, Mails, Servers

Hetzner

Mail service with Hetzner

  1. That's why we block ports 25 and 465 by default on all cloud servers. Please use 587 with tls encryption. I have tested with Hostinger email. Everything works ok.
  2. You can not recieve mails if you didn't configured DNS of mailing service in DNS provider (Cloudflare)

How to move domain from Hostinger to DigitalOcean

  1. I couldn't use CNAME for root domain (it doesn't works), so decided to get all dns names from hostinger to digitalOcean
  2. Also you should configure email profiles in Hostinger:

How to format and clean usb flash in Windows

  1. Powershell ->
  2. diskpart

  3. list disk

  4. select disk

  5. clean

  6. create partion primary

  7. format fs=ntfs

Excel Filter

=FILTER(B1:B661, B1:B661<>"")

filter and get only not empty values from 1-661 raws

@MuhammadQuran17
MuhammadQuran17 / ffmpeg_xmsi.md
Created April 22, 2025 11:21
ffmpeg video transformations

Compress video

ffmpeg -i 'Screen Recording 2025-04-22 154123.mp4' -vcodec libx265 -crf 28 cherry_pick.mp4