Skip to content

Instantly share code, notes, and snippets.

View M-Razavi's full-sized avatar
🏹
Focusing

Mahdi Razavi M-Razavi

🏹
Focusing
View GitHub Profile
@M-Razavi
M-Razavi / init.sh
Last active July 6, 2021 13:28 — forked from ocindev/init.sh
Convenient script to setup a WSL dev environment with Docker, sdkman.io, Maven, AdoptOpenJDK 1.8, NPM and Node.js
# Replace with your windows username
win_user=<replace>
# Update the apt package list.
sudo apt-get update -y
# Install Docker's package dependencies.
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
mvn clean install -DskipITs=true -DskipTests=true
@M-Razavi
M-Razavi / Search in multiline (REGEX)
Created December 10, 2021 17:12
Search in multiline (REGEX)
\bWORDA[\s\S]*?WORDB
\bWORDA[\s\S]*?WORDB(?=[\r\n])
@M-Razavi
M-Razavi / create-a-chrome-git-hub-search-shortcut.md
Last active March 16, 2023 14:11
Create a Chrome GitHub Search Shortcut

Create a Chrome search shortcut for your GitHub

If you only want to search in a specific repository, follow the Instruction-1 that David tweeted Winterbottom. For searching in whole repositories of organiation/user follow the Instruction-2

Instructions-1: search in a specific repository

  1. Open Chrome > Settings
  2. Search "manage search engines" and click into it

!! be very careful with these !! you may end up deleting what you don't want to

remove untracked

git clean -f -d

CAUTION: as above but removes ignored files like config.

git clean -f -x -d

CAUTION: as above, but cleans untracked and ignored files through the entire repo (without :/, the operation affects only the current directory)

git clean -fxd :/

@M-Razavi
M-Razavi / Docker cleanup.md
Created February 7, 2025 14:53
Docker cleanup.md

Prune unused Docker objects

Imagges

clean up unused images

docker image prune

To remove all images which aren't used by existing containers