Benjamin Lu

everyday is cool

Technology

Notes on web development, self-hosting, and troubleshooting.

Writing a Setup Guide from a Clean Checkout

Retrospective web development exercise for the 2020 archive. A setup guide is easiest to test when you follow it in a new directory. Check out the project, install its dependencies, and run the first command the guide gives you. Write down anything you had to remember from outside the instructions. … Continue reading →

A Container Port and a Host Port

Retrospective web development exercise for the 2019 archive. A local web server inside a container may listen on port 80 while your browser uses 8080. A mapping such as 127.0.0.1:8080:80 publishes the container’s port 80 on the host’s loopback address at port 8080. Start a small test service with that … Continue reading →

Reading an Application Log Backward

Retrospective web development exercise for the 2018 archive. When a request fails, note the URL, the time, and what the browser showed. Find the matching line in the web server’s access log, then look for an application error near the same time. Keeping the request in view makes it easier … Continue reading →

A Layout with CSS Grid

Retrospective web development exercise for the 2017 archive. Take a page with an article and a short list of related links. Wrap them in one container and try grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) on a grid with a gap. Make the layout one column at a narrow width. Put a … Continue reading →

Testing a Redirect Without Guessing

Retrospective web development exercise for the 2016 archive. A redirect is easy to test in a browser, but the browser can hide the intermediate response. Ask for the old URL with curl -sS -D - -o /dev/null and look at the status and Location header. Then request the destination separately. … Continue reading →

Keeping Development Settings Out of the Repository

Retrospective web development exercise for the 2015 archive. A project often needs two sets of values even when it has only one developer. The local database and the hosted database have different addresses and credentials. Keep a sample configuration with placeholder names and put real values in an environment-specific file … Continue reading →

Volunteering with WordPress

I started volunteering with WordPress in 2014 as a plugin and theme developer. By then I’d spent years teaching myself how to build websites. Volunteering gave me a reason to think beyond the site I was working on. If somebody else installed something I wrote, could they figure out what … Continue reading →

Reading a Theme Through Its Edge Cases

Retrospective web development exercise for the 2014 archive. A theme demo usually uses carefully chosen titles and photos. To learn what the theme does with ordinary content, make three test posts. Give one a very long title, leave the second without a photo, and put a long URL in the … Continue reading →

Testing a Site Before Changing DNS

Retrospective web development exercise for the 2013 archive. A hosting move is a good time to test a page that isn’t the homepage. Pick an old post, an image, and a route with a nested path. Make a list of the responses you expect on the new server before changing … Continue reading →

Serving One Page Over HTTP

Retrospective web development exercise for the 2012 archive. Open a page directly from disk and note that its address starts with file:. Then serve the same directory over HTTP on your own machine. On a current Python installation, python3 -m http.server --bind 127.0.0.1 8000 starts a simple lab server from … Continue reading →