Jeremy Cherfas: Posts

Jeremy Cherfas

Mo' better icons

A couple of weeks ago I wrote about replacing the icons that link to my various other web presences. Today I finished the job by swapping out all the font awesome icons I could find. The changes should not be glaring.

The crucial part about this, for Grav, is to place all the icons in a central store and then call them from there using the variables that Grav offers.

I keep all my site-wide images in user/mytheme/images/. In order to allow Grav to find them wherever it is, I use a variable to point to that location:

<img src="{{ url('theme://images/whatever.svg') }}" alt="whatever" height="32" width="32" style="display: inline;" ></i>

I had intended to use icons from The Noun Project, but in the end I found some others elsewhere. The nice thing about this approach is that if I do want to switch to other icons, as long as I give them the same filename, I don't actually need to change anything else.

Still on the to-do list for icons is a slightly trickier proposition of using an icon to identify a particular type of microblog post. At the moment I am passing the name of a font-awesome icon in the post's front matter. I'm sure I can do the same with any icon I have downloaded, but that's actually a minor issue for my whole micro-blogging system, which now moves up one step on the priority ladder.

Sat, 09 Feb 2019 15:30:00 +0100

Monthly report: January 2019

Trying to get a jump on this whole monthly thing by getting to work on it sooner rather than later. An end to procrastination, but not just yet.

I've become somewhat dissatisfied with my journalling arrangements, partly as a result of listening to an episode of Automators. MacSparky and Rose are both gung-ho for Day One, but then also duplicate their stuff all over the shop. I gave up on Day One because I don't want to pay a subscription and I don't want to have to deal with an export if (when?) something happens. So over the past year I've experimented with a single flat text file and also saving notes to exist.io every day. Both have drawbacks. Exist isn't actually easy to search, but it is fun to be reminded of things a year ago or three months ago. The daily text file is super easy to search, but not that attractive.

So the first thing I did, with help from Rose and people in the Automators forum, was build a little shortcut so that I could add to the text diary as easily from my phone as from the desktop. And that prompted me to clean up the workflow from the desktop. Now I want to think about maybe adding an image to the text file, which ought to be easy enough if I can settle on a place for the images to live.

The other thing I want to do is journal what I'm watching, reading and listening to. Back in the day I would write a little one-paragraph review of films seen and so on. That fell by the wayside when I moved my CMS to Grav, and I never really took to adding such things to my Stream. But I want to, as an aide-memoire as much as anything else. I have thoughts about how to do that based on the log files created by Jen Myers, which I found because I follow ~cgrayson. I've only just started thinking about this, and I have no solid idea of how I will implement it, let alone automate any aspect of it, but by this time next month I hope to have something to show for it.

That something will not include podcasts. For that, I have something else in mind, which will be to translate cleverdevil's very clever script for sucking all that information out of Overcast.

That's the plan, at any rate.

Our Daily Bread

Managed eventually to get over my fear of rejection and sent a package off to a possible new agent just within the month. Now another agonising wait. In the meantime, I've been reading up on self-publishing and how to make sure one doesn't completely screw up. So in the event, with luck I won't screw up.


Steps has been trending down gently since mid-November. Sixty-day rolling average on 3 February was about 8,800, vs 10,500 in mid-November. Still way better than the global average of 6,100, and I fully expect it to start climbing again as the weather improves. Average time asleep is up by 23 minutes over the same period, and that I fully expect to fall. It is so nice that the days are getting lighter at both ends.

I'm not surprised to note that the word most strongly associated with my worst mood rating is "brexit". And that's all I will say on the matter. Anxiety levels on that score are high.


Logged 95 hours for the month and worked on 17 of the 31 days. No logging for almost all of December, and started only on 7 January.) Not a huge amount of paid work this past month. Might need to put myself out there a bit more.

Month Total Daily Admin % ETP % Other %
01 95 5.4 39 13 48
10 100 4.2 41 34 25
09 131 6.5 45 23 32
08 185 8.0 14 85 1
07 68 5.25 25 63 12
06 96 5.75 34 9 57
05 151 6.0 36 20 44
04 159 7.5 29 29 40
03 152 7.0 20 10 70

I'm pretty sure there was some solid under-reporting this month,. But I'm not going to agonise.


Woohoo! 13 posts on this website, although three are old posts. Recorded Reading (a book, not the computer, for at least 30 minutes) on 11 days. More would be better


Some things have been on my niggle list for far too long. I am still very bad at finding good stretches of time to get back into code. I guess some of those things just aren't enough of a priority. Mind you, I did get the sparklines done, which I've been talking about since the October 2018 report.

Final remarks

Life is still good. I rate my mood as a 4 almost every day, with an occasional 5 and an even less frequent 3.

Mon, 04 Feb 2019 19:05:00 +0100

Happy to be the customer, not the product

Very happy to have given a little bit of support to Grav for the coming year. Do you use Grav? You can do the same by donating via Open Collective.

Fri, 01 Feb 2019 16:30:00 +0100

Simple Icons on Grav

Almost a year ago, on 13 February 2018, I left myself a note to use Simple Icon SVGs instead of font-awesome right down at the bottom of my home page, where I link to a bunch of the other online places that are "me". Now I've done it.

At first I planned to modify the About Me plugin to do the job. I gave up on that because it seemed overkill. (And hard.) The plugin had given me the HTML, and all I really needed to do was to use that as the foundation of a new partial template about.html.twig. I edited the HTML to use the icons I had downloaded, and then I call that template (instead of the About Me plugin's partial template) from recent.html.twig.

I'm quite pleased with how it looks. I even managed to snag the pnut icon. Now to think about converting the other icons scattered about the place, probably using images from The Noun Project.

Sun, 27 Jan 2019 16:45:00 +0100

50 x 100 x 50 revisited V

Which way?

Originally published 30-03-2008

"We'll be leaving in a moment. Especially if you can tell me the route."

I thought the bus driver was joking, an attempt to break the ice with his sole passenger early on Sunday morning. But no. He hesitated at a crossroads.

"Turn left," I yelled.

More people were getting on, and when he attempted to go straight through the lights there was a general outcry. And the car behind wouldn't reverse. A woman took up the challenge of keeping the driver on the straight and narrow. Where else would a bus driver rely on passengers to know the route?

Flickr photograph by sebastian.yepes.in 's

Some days

Originally published 31-03-2008

Some days, and I confess with pride that this is the first since I took my original tentative steps on this road to writing redemption, are so utterly bereft of publicly usable incident and inspiration that it fair boggles the imagination, looking back across the empty wasteland, to conceive of how it is that, forced to rely on mere reflex to drive the mechanism of the body, one emerges at the other end not only intact and with all senses functioning more or less at their customary level, but also, and this is the really unbelievable part, a dollar richer.

Flickr photograph by nettsu.

Things did happen

Originally published 01-04-2008

I was fibbing when I said that nothing happened yesterday. There was a whole heap of stuff, but many things are best left unblogged. So lets focus again on the unbelievable self-centredness of the average Italian behind the wheel of a car.

Works are taking place on the road to the station. The pavement is blocked for about 30 metres. Rather than crossing the road, I choose to walk close to the bright orange mesh. This morning a car's wing mirror clipped me as it went past, apparently unable to slow down for even a couple of seconds.

Flickr photograph by me.

Some other days

Originally published 02-04-2008

Hot date planned. First I was late out of my meeting. Then the late train was cancelled. I sent an SMS. Very late home, the dog unwalked, phone low on juice. Plugged it in. Dialled her number. and from the next room came that irritating tune. Phoned where she'd been, discovered she'd popped out to look for me, said if she came back I'd be down as soon as I could. Marched on down, dog in tow, and all was just fine. So we had a Campari in the piazza, ate and walked home. Hot date: accomplished.

Flickr photograph by Claudecf, who subsequently disabled downloading. No idea where I stand now.

Truth and beauty

Originally published 04-04-2008

It was a brief tussle. The sinister little red guy said, "Fake it." The putti on duty 1 chorused "Who would you be fooling?" And the putti won.

Two unforeseen social engagements yesterday conspired to deliver much merriment but no time to write. Hence the brief tussle. I could have faked it, and while I didn't make up the rules there's no actual punishment for breaking them. So I'm going with truth, at least this time. And a new rule. If I truly cannot, as opposed to will not, I don't have to.

Flickr photograph by kpishdad!

  1. The Squeeze's coinage. 

Fri, 25 Jan 2019 16:15:00 +0100

Sparklines improved

Sparklines are a Tufte invention to display data almost as a word. I like them, and built them laboriously by hand in the past, for example to track changes in how Board members rated aspects of my workplace's activities. Anyway, having suddenly become aware of an avalance of spam to WithKnown (which had been going on for a while) I decided to track it and, as an exercise, to display the data as a sparkline.

Kevin's code looks straightforward -- not sure I fully understand, but well enough -- but I could not seem to get it working in Grav. It worked when I called Kevin's svg script from his site, but not with mine, no matter where I put it.

Turned out, thanks to Sven and Rose, I was able to find a place for it, in mytheme/images and then call it from a new partial that is in turn called from the sidebar partial.

The main takeaway from this being that I need to learn to use the browser's developer tools instead of tearing my hair out.

I then wasted a lot of time trying to build the query in the Twig template, because I thought I had to concantenate the path with the data. But no.

A Twig variable is just expressed as whatever it contains. So the code is:

<embed src= "{{ url('theme://images/sparkline.svg') }}?7,6,3,4,2,23,14,6,2,,2,0,5,10,4," width="100" height="15">

No need to contantenate at all. And the benefit of using a relative url is, of course, that it works just as well on the production site.

I did reduce the size of the viewbox, at least until I have more data, and changed the colour of the line to match my colour scheme: ln.setAttribute("stroke", "#e15e0e");.

The only tweak I would make now would be to have the data in a separate file and get that into the Twig template somehow.


Thu, 24 Jan 2019 19:00:00 +0100

Bread site springs back to life

I have a website dedicated to my bread-baking efforts, but I've never seen the point of posting every time I bake a bread that I've baked many times before. So it can seem a bit abandoned, between new breads. Today, though, I wrote about a new approach that worked wonderfully well for me this past weekend. It's a version of the no-knead style pioneered by Suzanne Dunaway and popularised by Mark Bittman and Jim Lahey.

loaf of do nothing bread seen from the side

It is based on Yohan Ferrant's do-nothing bread, as outlined in a book called Respectus Panis, written by a group of bakers called Les Ambassadeurs du Pain. You can read about it on fornacalia.com.

Mon, 21 Jan 2019 16:00:00 +0100

Tracking spam

As I mentioned a while ago, I had been living in cloud cuckoo land with respect to spammers. I naïvely thought that my little microblog was of no interest to spammers. The truth was, I just wasn't being notified of the incoming dross. As a result, I'm afraid I might have got onto some lists as a very soft touch. Now that I am getting notified, I am trying to stomp on spam as soon as I can, and I recently found myself wondering whether the flood was increasing, decreasing or staying the same. To begin with, I wasn't keeping records. About 10 days ago I started to do that, recording the number of spam received per day and also the number of items deleted per say, which is often more because I am still deleting ones that came in while I was blissfully ignorant.

Today, I thought I would use that data to play with sparklines, which many people in the indieweb use to display data. I was inspired most recently by Ton Zylstra and Jeremy Keith, whose code I lifted. That worked fine; you can see the result over there in the sidebar. For now, I'm happy to update by hand once a week or so. At some point, however, I am going to have to go back and try to understand what the code is actually doing. Kevin Marks' article is where I'll start.

Sat, 19 Jan 2019 16:45:00 +0100

Comments plugin fixed

Comments to posts here are sufficiently rare that I get a teeny thrill when an email announces "Incoming". How quickly that turned to dust when I realised that although I had received the notification, of the comment itself there was absolutely no sign in the system. As in so many others CMSs, comments here are handled by a plugin, and when I went to check it was clear that the plugin, although authored by the core team, hadn't had any love in a long time.

So I rolled up my metaphorical sleeves and got stuck in. The first task was to read slowly through comments.php, trying to work out what was happening and why and adding notes to explain things to my future self. I should add that the plugin crashed after sending the email, and on a line of code that involved a variable called language. Other people had reported problems with language, so after stepping my way gingerly through the code and failing to find any important use for that variable in my setup, I just deleted that line. Somewhat to my surprise, it immediately crashed on the subsequent line.

Aha! The language thing was a red herring.

At this stage I was blocked by an inability to see what was going on in the plugin code because it kept crashing. That was when I discovered that it is possible to see the value of any variable by inserting dump($variable); into the code (followed by a die;, obvs). You end up with a very pretty display of whatever is there. And that was the breakthrough, because it showed that the code was testing for the existence of a thing that simply never existed.

$post = isset($_POST['data']) ? $_POST['data'] : [];

To translate, if the variable $_POST contains an element called data, make $post an array equal to that element. If it does not exist, make $post an empty array.

But when I looked at $_POST, it did not contain anything called data. Furthermore, the form that sends $_POST doesn't put anything called data into it. As soon as I removed that, everything worked exactly as I expected it to. A definite win. After that, it was trivial to reverse the order of the commands in comments.yaml to make sure that the notification email goes out after the comment has been received by the system. Thinking about that, though, I will probably change it back, because it was only because I received the notification that I knew someone had left a comment. And because I have those emails, I can go in and pretend easily to be the commenter.

I'm actually quite pleased by this result. I keep saying I'm not a developer, but I did manage to untangle the logic and work out how to fix it. There are gaps, I know; I should be testing in various ways for the wholesomeness of the incoming data, and I'm not sure how (or even whether) to submit my fix to the plugin's repository. But hey, it works for me. And that PHP course definitely helped.

I note, too, that the spammers must have given up at some stage, or I would have noticed much sooner. So, thanks again Ton and Peter for making the effort and thereby alerting me to the problem.

Tue, 15 Jan 2019 18:30:00 +0100

Annual report: 2018

Monthly reports have been going more than a year now, even if I have missed a few, including last December. What to add for an annual report? I think this has to be a different kind of beast, more like a GTD high-level view. But there's still room for some low-level stuff, down at the bottom, thanks to Exist.

The highlight of the year was undoubtedly my podcast series Our Daily Bread. I didn't miss a single day, though I came perilously close on occasion, and in general people seemed to like it. Certainly I got a lot of very useful, and very welcome, feedback, including many requests for a book. That ought to be easy as everything was scripted, but I have failed to follow up effectively. It took ages for first my old agent and then a book crowdfunding site to reject the proposal, and now I'm torn between having another go at a "real" publisher (which means persuading a new agent to take it on) and self-publishing. Fear of further rejection is keeping me back, which I know is silly, but there it is.

And another couple of questions: is there any useful way to re-use the audio? And what should I do for the Dog Days of Podcast this year? More wheat and bread, or something else entirely?

Overall, the podcast kept me more than busy, and I really enjoyed the many different topics and all the many people who gave so generously of their time and expertise. How much I enjoyed it all came home when I tried to pick a single best episode to enter for an award, given that it seemed I could not enter the whole of Our Daily Bread. I dithered like crazy, unable to decide, and almost missed the deadline. Not going to give any further details for fear of jinxing myself, said the great rationalist. There are a couple of other awards coming up, and if anyone knows of a place that might recognise a series of 31 episodes of around 6 minutes each, I'm all ears. Even more so if you know anyone who might fund an expansion into a much more comprehensive podcast series.

I had some good paying jobs too over the year, perhaps the most interesting of which was about water-management in the Ganges basin. Good trips to meetings for my own edification too. Mostly, I paid my own way, although the Food Communication conference in Edinburgh was kind enough to waive the registration fee. My second ever IndieWeb Camp in Nürnberg was a blast, and resulted in a fun podcast episode. That's the justification for all trips, to record raw material, and it usually works out pretty well. I've already got one trip lined up for 2019, and I'm looking for others.

On the formal learning front, I did a course on PHP that was really interesting and that gave me the grounding I knew I needed. Short term, it helped me a lot, automating a few things on my websites. Longer term, though, a tool unused grows blunt. I've not been able to bury myself in a coding project to the extent that I would like, to cement what I am learning. An even greater problem is that I miss being able to easily discuss the diffficulties I face. Not sure how to fix this. I think the ideal would be to timetable a couple of hours a day (it needs to be almost daily) and see whether that makes a difference. There are plenty of things to tackle, perhaps the first of which needs to be why the comments on this site no longer work. (Webmentions do, which is gratifying.)

The whole question of websites remains something unsettled. I still really like Grav, which runs this site, but it seems to be getting more and more complex and I'm having trouble keeping up. I'm not too keen on the way WordPress is developing. That's the engine behind Eat This Podcast, Fornacalia and the evergreen agricultural biodiversity weblog, which is now almost entirely fed by Luigi (I just keep the lights on). The first two are not so big that I couldn't move them, but ABW is a beast. The biggest worry, though, is Known. It was my gateway into the IndieWeb and it just works, but it does so in idiosyncratic (and to me unfathomable) ways.

So, the big question: to carry on with it, or to spend more time building the tools (Micropub, mostly) that would allow me to create a stream right here in Grav? I've made some good progress with that over the past year, and it would definitely give me the concerted and useful project I need to work on. It would be so handy to automatically gather here the bookmarks, likes, things I've watched or listened to or read etc.

The low-level stuff

My year as recorded by Exist

Exist provided a couple of nifty summary images for the year and for my average day. There are a couple of surprising things in there. It seems impossible that I walked almost 2900 km. Maybe by this time next year my geoskills will be sufficient to draw a circle of known radius centred on a map point, and see where I might have got to. Time in bed and time asleep are no great surprise, given the old saw about "a third of your life". I'm sure the discrepancy is the result of some nights not having been recorded, which would seem to be the case given my daily average.

Daily averages as calculated by Exist

On the daily averages, no surprises either, and only one thing I would prefer to be lower over the course of 2019.

Not going to say anything detailed about hours worked or any of that. Nor about goals. I need to go back, see what my monthly goals were, see how well I achieved them, and see whether they actually did me any good.

P.S I don't want to clutter up my site by creating an "annual" tag, so this entry is among the "monthlies".

Sun, 13 Jan 2019 19:30:00 +0100

Page created: Fri, Feb 15, 2019 - 09:00 PM GMT