This is something I run into pretty often, so I thought I'd share how I handle it, in case it's helpful. Sometimes you have a list of image files, and you need to create the html formatting to make them into a gallery of some sort. Imagine each file has two versions, a full size and a thumbnail image. Pretty common scenario. The URL for the files will look like /images/gallery/full/[filename] and /images/gallery/thumb/[filename] There's lots of ways to do this, here's what works well for me. First I grab a list of the files from the command line, ending up with something like this ls -l -rwxrwxrwx 1 user group 388044 May 25 11:16 IMG_20161205_120541.jpg -rwxrwxrwx 1 user group 451788 May 25 11:16 IMG_20161215_114201.jpg -rwxrwxrwx 1 user group 298125 May 25 11:16 IMG_20161216_121618.jpg -rwxrwxrwx 1 user group 369981 May 25 11:16 IMG_20161216_125940.jpg -rwxrwxrwx 1 user group 479464 May 25 11:16 IMG_20161216_131010.jpg -rwxrwxrwx 1 user group 664528 May 25 11:16 IMG_20...
A repository of handy little tips I'm building for the benefit of my fellow web developers.