Skip to content

Instantly share code, notes, and snippets.

View soroushm's full-sized avatar
🧬
Coding...

Masoud Soroush soroushm

🧬
Coding...
View GitHub Profile
@soroushm
soroushm / en.md
Last active October 4, 2025 09:29
Install CocoaPods on a Mac

Install CocoaPods on a Mac

To install CocoaPods on a Mac with an M1, M2, M3, M4 chip (Apple Silicon, ARM architecture), the process is almost the same as on an Intel Mac, but there are a few things to keep in mind regarding Ruby compatibility and Homebrew setup. Here’s the recommended approach:


🔧 Step 1: Install Homebrew (if not already installed)

Homebrew makes managing dependencies much easier.

@soroushm
soroushm / en.md
Created August 3, 2025 22:21
Mastering React Hydration: From SSR to Full Interactivity

Understanding Hydration in React: Why It Matters and How It Works

Before diving into the concept of hydration in React, it’s important to understand two foundational rendering strategies: Client-Side Rendering (CSR) and Server-Side Rendering (SSR). These approaches set the stage for why hydration is necessary and how it optimizes the user experience.


Client-Side Rendering (CSR)

In client-side rendering, all rendering takes place in the browser using JavaScript. When a user navigates to a page, the browser loads a minimal HTML shell and then fetches JavaScript to render the actual content. This results in longer initial load times and can lead to a blank screen until the JavaScript is fully executed.

@soroushm
soroushm / en.md
Last active July 29, 2025 23:23
How to Use Husky with pretty-quick to Improve Git Workflow

The Problem

Inconsistent code formatting makes code review difficult. When each developer uses a different style, every pull request ends up filled with formatting changes that reduce the readability of the actual code modifications.

Whether you're working solo or on a team, life’s too short to argue about The One True Brace Style or the eternal tabs vs spaces debate.

Tools like ESLint and Prettier solve this by automatically enforcing a consistent style guide. You can run Prettier manually via the command line or have it auto-format on save in your editor. However, this setup relies on each developer having their tools configured properly and it’s easy for that configuration to be missed, misconfigured, or simply forgotten.

Ideally, we want to ensure Prettier and ESLint run automatically after code changes are made but before they're committed to the repository.