Skip to content

Instantly share code, notes, and snippets.

View NurdinDev's full-sized avatar
🎯
Focusing

Nureddin Badawi NurdinDev

🎯
Focusing
View GitHub Profile
@dhh
dhh / linux-setup.sh
Last active June 13, 2024 03:49
linux-setup.sh
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT.
#
#
# Libraries and infrastructure
sudo apt update -y
sudo apt install -y \
docker.io docker-buildx \
build-essential pkg-config autoconf bison rustc cargo clang \
@wojteklu
wojteklu / clean_code.md
Last active June 18, 2024 15:19
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@davemac
davemac / pullprod
Last active July 10, 2021 03:42
bash alias using WP-CLI to pull a remote WP database into a local site
# pull a production WP database to an existing local site
# uses current directory as theme path and ssh alias
pullprod() {
START=$(date +%s)
# get current directory name, used for database and URL
# TODO: use echo get_template_directory() and get characters from right to first /
current=${PWD##*/}
cd ~/Sites/$current
# make a backup of the current local database
wp db export _db.sql