I've recently merged a PR by Stephen to rst2df that reformats the entire codebase to align with PEP 8. As rst2pdf is over a decade old, this has resulted in a lot of changes to the files which now have Stephen's name attached. This affects git blame. For example:
git blame -L 137,145 rst2pdf/findfonts.py
e753c71eb (roberto.alsina 2008-09-05 14:49:24 +0000 137)
d56705e4f (roberto.alsina 2009-10-30 15:07:05 +0000 138) # So now we have a font we know we ca
825ba00bb (Stephen Finucane 2020-06-08 11:06:59 +0100 139) for n in (
825ba00bb (Stephen Finucane 2020-06-08 11:06:59 +0100 140) fontName.lower(),
825ba00bb (Stephen Finucane 2020-06-08 11:06:59 +0100 141) fullName.lower(),
825ba00bb (Stephen Finucane 2020-06-08 11:06:59 +0100 142) fullName.lower().replace("italic"
825ba00bb (Stephen Finucane 2020-06-08 11:06:59 +0100 143) ):
4e4158508 (Roberto Alsina 2019-03-13 14:40:55 -0300 144) fonts[n] = (afm, pfbList[baseName
e753c71eb (roberto.alsina 2008-09-05 14:49:24 +0000 145)
Stephen is now implicated as having changed this for loop, but all he did was run the tool that reformatted it. –ignore-rev to the rescue!… continue reading.
I'm in the process of writing a little command line app in Go that uploads images to Flickr. It's called Rodeo and it's working well as a project with which to learn Go in 2020. Rodeo uses ExifTool to interrogate an image file for meta data. ExifTool is wonderful and very comprehensive and with the -j switch can return JSON. Today I want to note down what I learned about dealing with JSON.
$ exiftool -j -iptc:* -exif:* RKA-glorious.jpeg
"Country-PrimaryLocationName": "United Kingdom",
"Caption-Abstract": "On a wet gala weekend, Glorious returns after its 2018-19 restoration",
"Keywords": ["diesel","50 033","Severn Valley Railway","Glorious","railway"],
"ObjectName": "Glorious Sunrise",
"ImageDescription": "On a wet gala weekend, Glorious returns after its 2018-19 restoration",
"DateTimeOriginal": "2019:10:04 11:50:40",
(For… continue reading.
I recently needed to validate the value created by PHP for its session ID. After a bit of research, I realised that there are two interesting php.ini config settings that relate to this value: session.sid_length is the number of characters in the ID session.sid_bits_per_character controls the set of characters used. From the manual: The possible values are '4' (0-9, a-f), '5' (0-9, a-v), and '6' (0-9, a-z, A-Z, "-", ","). Therefore, to validate the session… continue reading.
I recently received a MySQL dump file where the various tables in it had foreign keys to each other. I usually restore with this command: mysql –login-path=rob < dump.sql but this generated the error: ERROR 1217 (23000) at line 288805: Cannot delete or update a parent row: a foreign key constraint fails It turns out that the easiest way to solve this is to use the –init-command switch to set foreign keys off for this… continue reading.
All projects seem to have a logo these days, so I asked my friend Jane of iD to create a logo for rst2pdf and she came up with this: This met what I was looking for with a clear design that is related to the what the application does, so thank you Jane. I've set the profile icon for the GitHub organisation and Twitter accounts and we'll be using this in other places as we… continue reading.
I currently organise my photo library in Lightroom Classic with one folder per day for my images and then I extensively use collection sets, collections and smart collections to manage the photos that represent an "event", regardless of whether the project is a single day, such as a family BBQ, a multi-day event such as a conference or a multi-month thing such as my Project 365 or mainline railway photos. The nice thing about using… continue reading.
As part of my migration to Lightroom Classic from Photos, I needed to recreate my folder and album structure. In Photos, folders container albums (or other folders) and albums contain photos. An album cannot contain a folder. This maps directly to Lightroom Classic which has "collection sets" for folders and "collections" for albums. To transfer the folder and album information over to Lightroom Classic, I wrote an Apple Script for Photos that added a keyword… continue reading.
As we reach the end of 2019, I again get the opportunity to look back at my year through the photos that I took as I have done every year since 2009. I have been doing a Project 365 for a good few years which acts as a diary too, so I have the opportunity to appreciate what happened this year in my life. January Early in January, I spent an afternoon taking photos with… continue reading.
I recently moved over to Adobe's Lightroom Classic from Apple's Photos in order to have more flexible non-destructive editing features – in particular local brushes. Rather confusingly, there's also another Adobe product called Lightroom which is a new build for cloud-based storage which doesn't (yet?) have all the features of Lightroom Classic. In particular, the lack of virtual copies and smart collection sets make Lightroom feel like a step backwards from Photos, while Lightroom Classic… continue reading.
Routing in Slim 4 works pretty much exactly the same as in Slim 3. They are used to map a URL that the browser requests to a specific handler that executes the code for that particular page or API endpoint. You can also attach middleware that will only be run when that route is matched. The route in the slim4-starter looks like this:
It is made up of the method, the pattern and the… continue reading.