This page has moved to https://0xdstn.site/wiki/development. Please update your link to view the latest version.
~dustin hello writing thoughts reading feeds
..

📘 Development notes

This page contains any notes I find useful related to software/web development.

  1. Snippets
  2. Tricks
  3. Tools

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

Web

👋 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.