Posts

How to forget to run php ./vendor/bin/drush cr for ever

Image
How to forget to run php ./vendor/bin/drush cr for ever Yes, it is possible to automatically run   php ./vendor/bin/drush cr   on file save, typically by using file-watching tools like   nodemon ,   entr , or IDE-specific plugins (e.g., VS Code "Run on Save"). These tools detect file changes in your Drupal directory and execute the drush command to clear the cache.   Using  nodemon  (Node.js): Install  nodemon  and run: nodemon --watch web/modules --watch web/themes --ext php,yml,twig --exec "php ./vendor/bin/drush cr" Using  entr  (Unix tool): find . -name "*.php" -o -name "*.yml" -o -name "*.twig" | entr -p php ./vendor/bin/drush cr IDE Extension (VS Code): Install an extension like "Run on Save" and configure it to trigger  php ./vendor/bin/drush cr  when PHP, YML, or TWIG files are saved. Performance:  Automatically clearing cache on every save can slow down development, especially with large projects. Pathing: ...

Tmux - work cases and tune up

Image
 Tmux - work cases and tune-up how to scroll rows in tmux terminal splited windows how to save sessions, layout, dirs and even progs state in tmux how to change horizontal split to vertical split in tmux how to add horizontal and vertical splits in tmux + key bindings how to exit tmux but leave session working  how to attach session to tmux how to know how many sessions you have how to kill sessions how to swith-between sessions how to rename sessions and panes (panes are small part of the window - splatted in tmux) How to reload tmux configuration from tmux BONUS: visual cheat-sheet   almost all settings are made in mine  .tmux.conf you can download from my gist  put this file into your home directory after you install tmux on your system For those who don't aware what is it - this is terminal shell and you can install it for your distro like sudo apt-get install tmux (for Debian like Ubuntu etc.) 1. How to scroll rows in tmux term...

Adding not root user to Docker container

 Adding not root user to Docker container  in docker file: ARG USERNAME=containeruser ARG USER_UID=1000 ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME \     && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \     && chown -R $USER_UID:$USER_GID /home/$USERNAME     # [Optional] Add sudo support if needed     # && apt-get update && apt-get install -y sudo \     # && echo $USERNAME ALL=(root) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \     # && chmod 0440 /etc/sudoers.d/$USERNAME # Set the default user for all processes in the container (optional, but ensures everything runs as this user) # USER $USERNAME

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...