Posts

Visual representation - Timeline of a React Component With Hooks (link)

Visual representation - Timeline of a React Component With Hooks (link) Timeline of a React Component With Hooks   

30 маловідомих, але корисних команд Linux (repost)

Image
  30 маловідомих, але корисних команд Linux Саме тому ми зібрали  31 команд , які не згадуються в кожному гайді, зате дійсно виручають. Особливо, коли часу обмаль, а результат потрібен вже. lsd - те саме що ls але краще lsd -l --permission octal --> тільки для нових версій lsd > 1.1.0 Базові трюки з терміналом Тут зібрали ті маленькі команди, які часто рятують нерви. Повторити, очистити, знайти чи навіть написати. Повтор останньої команди Забув додати  sudo  та отримали «Permission denied»? Не переписуй всю команду заново — просто використай: sudo !! Очищення екрана Коли термінал заповнений виводом і хочеться почати з чистого аркуша, натисни  Ctrl+L , щоб миттєво очистити екран. Редагування поточної команди в редакторі Якщо команда занадто довга або складна, натисни  Ctrl+x  +  e , щоб відкрити її в текстовому редакторі для зручного редагування. Коротка довідка по команді Замість читання довгих man-сторінок, юзай  tldr   для отрим...

Advanced work with git stash

Advanced work with git stash In Git, the most recent stash is  always  assigned the index  0 , appearing as  stash@{0} . When you create a new stash, all existing stashes are pushed down the stack (e.g., the previous  0  becomes  1 ).   1. Identify which stash is yours To see all your stashed entries and their assigned numbers, use: git stash list   This will output a list like this: stash@{0}: WIP on master: 4fd1101...  (Latest) stash@{1}: On develop: updated files...   2. View contents without applying You can inspect the contents of any stash entry using the  show  command. View a file summary (stat): git stash show stash@{0} (Shows only the list of files changed and the number of insertions/deletions) View full code changes (diff): git stash show -p stash@{0} (The  -p  or  --patch  flag shows the actual line-by-line code changes) View untracked files: git stash show --include-untracked stash@{0} Vie...

ENV variables files load ordering

 ENV variables files load ordering Standard Loading Order (Highest to Lowest) .env.local  (local overrides, all environments) .env.[mode].local  (local overrides, specific mode) .env.[mode]  (e.g.,  .env.development ) .env  (default settings)   Example: If  DB_HOST  is defined in both files, the value in  .env.local  will be used.

Comparison VS Code, Cursor, Windsurf, Trae, Kiro, Replit

Comparison VS Code, Cursor, Windsurf, Trae, Kiro, Replit VS Code, Cursor, Windsurf, Trae, Kiro, and Replit represent a spectrum of modern coding environments, ranging from a highly extensible, traditional local editor (VS Code) to fully cloud-based, AI-driven development and deployment platforms (Replit). Most of the others are AI-first IDEs built on or heavily inspired by VS Code.   Feature   VS Code Cursor Windsurf Trae Kiro Replit Platform Local desktop app Local desktop app Local desktop app Local desktop app Local desktop/CLI Cloud (browser-based) Core Philosophy Extensible, traditional editor AI pair programmer w/ local control Agentic automation & deep context Fully free, AI-enhanced editor Spec-first AI agent All-in-one build/deploy platform AI Integration Via extensions (e.g., Copilot) Deeply integrated AI chat & refactoring Agent-focused, multi-file awareness Built-in models (GPT-4o, Claude 3.5) Agentic IDE, starts with a spec Built-in Ghostwriter AI & Ag...

Export Git Stash as patches

Export Git Stash as patches  git stash show -u -p --binary stash@{0} > your_changes_name.patch -u   - for untracked files -p - patch -binary - for binary files (images) stash@{0} - for fist stash (most fresh one) now you can transfer the  your_changes_name.patch  file to the target machine/repository (e.g., via email, USB drive, or cloud storage). In the target repository: Verify the patch  (optional):  git apply --check  your_changes_name.patch Apply the patch :  git apply  your_changes_name.patch . You may use  --ignore-whitespace  options if conflicts arise due to formatting differences. The changes will appear in your working directory as unstaged modifications

Grep cheat sheet

Image
Grep cheat sheet source  https://x.com/thatstraw/status/1789624772826890614

Git, how to know all committers names in the project

Image
Git, how to know all committers names in the project To identify all committer names in a Git project, use the  git shortlog  command with specific flags: git shortlog -sne --all Explanation of flags: -s  (or  --summary ):  This flag summarizes the output, showing the number of commits by each author. -n  (or  --numbered ):  This sorts the output by the number of commits, with the highest contributor at the top. -e  (or  --email ):  This displays the email address of each committer alongside their name. --all :  This ensures that the command considers all branches in the repository, not just the currently checked-out branch. Output: The command will produce a list of committers, each followed by their email address and the total number of commits they have made across all branches.  For example:     20  John Doe <john.doe@example.com>     15  Jane Smith <jane.smith@example.com> ...

Git patch workflow

  In the  Git , you can apply patches using the  git apply   command for changes from a   git diff   or   git am   for patches generated by   git format-patch . The method you choose depends on the patch's format and whether you want to create a new commit.   Before you apply a patch Back up your work.  Before applying a patch, you should have a clean working directory . Either commit or stash your uncommitted changes to avoid complications. Use a temporary branch.  It's a best practice to create a new, temporary branch to test the patch. If something goes wrong, you can simply delete the branch without affecting your main codebase. sh git checkout -b temp-patch-branch Use code with caution. Check the patch.  To see if the patch will apply cleanly, run a check with the  --check  flag. sh git apply --check my_patch.patch Use code with caution.   Method 1: Using  git apply Use this command for patches cre...