Code Snippets
A collection of useful code snippets and examples
How to make a bash script run by command alias
🧠Quick Guide: Convert Bash Script to Alias
1. Make Script Executable
chmod +x ~/scripts/myscript.sh
2. Add Alias to Shell Config
Edit your shell config file (~/.bashrc, ~/.zshrc, etc.):
alias myalias="~/scripts/myscript.sh"
3. Apply Changes
source ~/.bashrc # or ~/.zshrc
4. Use It!
Now run:
myalias
View snippet
🧪 Django – Run Tests for a Specific App
4. 🧪 Django – Run Tests for a Specific App
To test only one app (e.g., blog
), run:
python manage.py test blog
You can also run a specific test case or method:
python manage.py test blog.tests.MyTestCase
python manage.py test blog.tests.MyTestCase.test_example
✅ Speeds up testing by skipping unrelated apps.
View snippet