Benjamin Lu

everyday is cool

Technology

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

Counting Website Pages with Python

Written retrospectively for the 2003 archive. Python 2.3 was released in July 2003. A little file-counting script is a way to revisit the kind of site maintenance task that was useful then. Run this version with a current Python installation: import os count = 0 for name in os.listdir("."): if … Continue reading →

What Early WordPress Changed

Written retrospectively for the 2003 archive. WordPress made its first public release in May 2003. Looking back from a site built with separate HTML files, the change worth noticing is where the work of publishing went. A new entry could be stored by the blogging software and shown through a … Continue reading →

Keeping Relative Links Working

Written retrospectively for the 2003 archive. A small site is easy to move until the first link points back to a folder on your own computer. To see how portable links work, make an index.html file and put an About page in pages/about.html. From the homepage, link to pages/about.html. From … Continue reading →

A Little Python Script for Website Files

Before uploading a folder of pages, it helps to have a list of the HTML files it contains. This retro exercise uses simple Python syntax from the Python 2.2 era to print a list. The same script runs on modern Python 3. Save this as list_pages.py in a folder containing … Continue reading →

Reusing a Header and Footer with PHP

Suppose the home and About pages have the same navigation and footer. Copying those sections works until you want to add a link and have to remember every page that contains a copy. A small PHP include puts each shared fragment in one place. Create header.php with links to index.php … Continue reading →

A First PHP Page in the PHP 4 Era

In a PHP 4-era site, one early lesson was that the server could do part of the work before sending a page to the browser. You can recreate that lesson with a modern local PHP installation and a small script that uses syntax from the period. Save this as hello.php: … Continue reading →

What Xanga Made Easier

My earlier Xanga post was about the appeal of having a place on the web where I could write and visit other people’s pages. Looking back, one thing that stands out is how different the act of publishing felt. On a hand-built site, a short update might mean opening the … Continue reading →

Uploading a Website with FTP

Editing a file on your computer and changing the page on your website were two separate steps in a typical FTP publishing workflow. It helped to keep track of which copy you were looking at. A safe way to recreate the workflow is to use a test server. Keep a … Continue reading →

Making a Homepage Load Faster on Dial-Up

A page with a few pictures can take much longer to load than its HTML suggests. Here’s a way to recreate that constraint without needing a dial-up connection. Take a photo and save two versions. Keep one at its original size and make another near the size you actually display … Continue reading →

Testing an Old Page in Two Browsers

A page looking right in one browser tells you how that browser handled your code. To recreate a compatibility check from the early web, take one small page and compare it in two period browsers, such as Internet Explorer 6 and Netscape 7. Use offline virtual machines if you have … Continue reading →