📘 Development notes
This page contains any notes I find useful related to software/web development.
Snippets
Display all PHP errors
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
PHP Web Server
php -S 0.0.0.0:8000
Python 2 Web Server
python -m SimpleHTTPServer
Python 3 Web Server
python -m http.server
Create an uppercase GUID in Powershell
[guid]::NewGuid().toString().ToUpper()
Entity Framework
Add migration
dotnet ef migrations add MigrationName
Run migrations
dotnet ef database update
Rollback migration
dotnet ef database update PreviousMigrationName
Rollback all migrations
dotnet ef database update 0
Remove most recent migration
dotnet ef migrations remove
Tricks
Github web editor
You can edit a github repository by pressing .
while viewing it. This will open up a VS Code web editor with the source of the repository.
Raspberry pi setup
Enable ssh
In /boot create a blank file called ssh
Enable wifi
In /boot create a file called wpa_supplicant.conf with the following:
Set up Apache + PHP
sudo apt update
sudo apt install apache2
sudo usermod -a -G www-data [USERNAME]
sudo chown -R -f www-data:www-data /var/www/html
sudo chmod -R 770 /var/www/html
sudo apt install php
Wttr.in
View the weather forecast via the command line
curl "wttr.in/Spokane?0"
Tools
CLI
- fish Shell alternative with auto complete
- tmux Terminal multiplexer
- ack File contents search tool
- bat A
cat
alternative with syntax highlighting - htop An interactive
top
alternative - exa A
ls
clone with better syntax and coloring - alder A
tree
alternative - mycli Alternative interface for working with MySQL
- ranger File manager/browser
- jpegoptim JPG optimizer
- optipng PNG optimizer
- gifsicle GIF optimizer
- HTTPie View source of a website from any device, including mobile
- dig Viewing DNS information for a domain -
sudo apt-get install dnsutils
Web
- SVGOMG An SVG editor/optimizer
- RegExr A regex playground/debugger
- View Source View source of a website from any device, including mobile
- xkcd Password Generator Generates 4 random words
- Password generator Generates passwords in-browser
- Git explorer Git command reference
👋 Hey! Thanks for reading! If you have any comments or questions about this post, or anything else, I'd love to chat! You can find the best way to contact me on my hello page or send me an email.