Skip to content

Instantly share code, notes, and snippets.

View vanduc1102's full-sized avatar
🐛
💯 💯 💩 😆 🐢

Duke Nguyen vanduc1102

🐛
💯 💯 💩 😆 🐢
View GitHub Profile
@jasewarner
jasewarner / gitignore-for-wordpress-theme
Last active August 17, 2024 22:37
WordPress project .gitignore
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except the themes directories
wp-content/*
!wp-content/themes/
# ignore all mu-plugins, plugins, and themes
# unless explicitly whitelisted at the end of this file
@wojteklu
wojteklu / clean_code.md
Last active September 20, 2024 15:06
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

@gavinengel
gavinengel / magic-globals.js
Last active April 3, 2023 10:56
"Magic Globals" for node.js
// sets globals:
// __stack,
// __line,
// __file,
// __function,
// __ext,
// __base
// we already have these:
// __filename which gives as an example: /Users/mjr/example.js