a talking point

We live in a flat in a terraced house, I think it was converted to flats some time in the 80s or 90s. It’s a standard sort of place with a low wall that separates the front “garden” (all flagstones) from the pavement. People stop and sit on the wall to chat all the time. No idea why, and no idea who they are. Maybe it’s perfectly butt height? Or the perfect width? Or it’s well positioned under a big, fluffy tree? Who knows. It’s kind of nice.

A foraging foray

Poplar mushrooms

This past Saturday, I went on a guided foraging walk with Daisy in east London. Got way too much sun!

It was so helpful to have a guide. I’ve considered just trying it with a book, but it’s hard to beat being able to ask questions and watch the way someone else watches. It reminds me of learning how to draw or paint, part of learning how it works is learning how to change your perspective. So it’s useful to observe the way someone else sees things. I’d still like to get a good book about it, but now I feel like I have a better idea of what I’d like to get out of that book.

The walk was from 10:30am to 2:30pm with one bathroom break but pretty much no other stops. Didn’t really need to stop for lunch since we were grazing anyway, but we did pause at the floating bakery. I had one of the best muffins I’ve ever had, felt like I needed to lie down afterward. He’s open Friday to Sunday, worth checking where he’s at online since he moves around a little.

Read list of what we saw and collected

uninvited odours

My grandma on my dad’s side was a great cook and known throughout the family for her dislike of garlic. I think she was convinced that it would “come out of the pores”, that you could smell it on her if she ate it. We all thought this was preposterous. WELL. Now suddenly I’m noticing it… I think her garlic affliction has caught up with me. Was she trying to warn us about a simple fact of life for some 30+ year olds? Were we all wrong? Not enthused.

chickpeas for days

Made a chickpea salad last night that was a riff on this one by Bon Appétit and loved it, ended up finishing the whole thing. I’ll definitely make it again. My changes (due to dietary stuff and what I had on hand) were:

  • Didn’t have any parsley and not enough basil (scrounged a tiny amount from my not-happy plant), so I bulked it out with big handfuls of chopped spinach
  • Added ½ of a small bulb of fennel, sliced very thinly
  • Added about ⅛ of a cucumber chopped in to quartered rounds
  • Added one very finely chopped scallion
  • Used lactose-free “cheddar”

You could easily make a ton of different tweaks. I’d like to make it with some tahini whisked in to the lemon, sumac, a very thinly sliced red onion, and some mint. Or do a ginger + garlic + soy sauce + rice vinegar dressing, swap basil for coriander, drop the cheese, and maybe swap some of the chickpeas for edamame. That might be lunch today.

Setting up Laravel Valet + MySQL via Homebrew

After far too much delay, I’ve finally ditched MAMP Pro. It’s taken me too long really, that software is decidedly… not nice.

I’m now trying Laravel Valet + MySQL via Homebrew for local PHP development on my MacBook Pro. See notes below for future reference. I had some fiddly points getting started and expect there to be more, but am pretty pleased with the change overall.


0. Back up databases

The pre-step is to back up any preexisting databases so that you can set them up later if needed. Personally, I use Sequel Pro for all local and some remote database management, so I pulled my necessary exports from there.

1. Install and configure Laravel Valet

The first step is to install Laravel Valet. Their installation docs are pretty much all that is needed. The only caveat is that I’d be a little careful about updating Homebrew or Composer willy nilly, just be wary if you already have it installed and need your preexisting version for any reason. While completing the installation steps, pay attention to the warnings! Complete any recommended steps if you can, they pop up for a reason.

If all went well, at this point you should have an Apache server so you’d be ready to work on a file-based website such as one that uses Kirby CMS or a static site generator (Hugo, Gatsby, Jekyll, etc).

2. Install and configure MySQL with Homebrew

To work on a database-driven site like a Craft CMS or WordPress build, the next step is to install MySQL via Homebrew.

The Laravel Valet docs mention this step, but for me it was nowhere *near* as simple as their two-command recommendation. I think there was likely a conflict with my preexisting MAMP-specific MySQL setup and possibly an old Homebrew installation. I ran the commands from the Valet docs to install MySQL v5.7 and run it, but I would get the error The server requested authentication method unknown to the client [caching_sha2_password] on the front-end. This error indicated that it was actually running MySQL v8 (read more). Sure enough, mysql --version returned mysql Ver 8.0.16 for osx10.14 on x86_64 (Homebrew). To sort it out, I had to reinstall and restart the MySQL service.

To remove MySQL, I followed these instructions. (Be careful with those commands, they remove a lot of stuff.)

After I’d gotten rid of MySQL, I ran the commands below to install, link, and start the service.

brew install mysql@5.7
brew link --force mysql@5.7
brew services start mysql@5.7

Note that I tried doing this without the link but consistently ran in to the error Can't connect to local MySQL server through socket '/tmp/mysql.sock' when trying to connect in the next steps. Linking seemed to sort it.

After this, I followed the installation’s recommendation and ran mysql_secure_installation. This is so that we set the root user’s password since it is required for phpMyAdmin and Sequel Pro (coming up next).

3. Set up and / import databases

Once MySQL is set up and running, it’s time to configure the databases. To do this via the command line, run mysql -u [username] -p [databasename] < [filename.sql] (replace bits in brackets) and when prompted, enter the password you set up via mysql_secure_installation.

Otherwise, you can do it via a UI such as phpMyAdmin (see Laravel Valet-friendly steps) or Sequel Pro.

4. Adjust PHP settings (optional)

I usually adjust my PHP settings (e.g. memory_limit, max_execution_time, post_max_size, etc.) per-project so that they’re closer to the site’s production hosting environment. I thought it would be as simple as adjusting the php.ini file that is specified in the “Loaded Configuration File” value returned by phpinfo(). I edited /usr/local/etc/php/7.2/php.ini and then ran valet restart to restart the server and… it didn’t work. One of my changes was respected according to phpinfo(), but the rest weren’t.

I checked the “Additional .ini files parsed” value and saw that the file /usr/local/etc/php/7.2/conf.d/php-memory-limits.ini was also in use. After I edited this file to include my preferred settings and restarted Valet, all was well.

5. Adjust Nginx config (optional)

Valet’s default Nginx config should normally be sufficient, but you might have to tweak it for certain edge cases.

My edge case was the British Earways site (read more). I was working with it locally and suddenly ran in to a 413 Request Entity Too Large error when attempting to upload a very large audio file. To get around this, I needed to raise the client_max_body_size Nginx directive.

To adjust the Nginx configuration, I first had a look at the main config file by running /usr/local/etc/nginx/nginx.conf. Scanning through that, I saw a few includes:

include "/Users/[username]/.config/valet/Nginx/*";
include servers/*;
include valet/valet.conf;

I had a look at valet.conf, found client_max_body_size and changed that value to suit my requirements, and then restarted the server by running valet restart.

Other useful things

  • Run brew services list to find out which services are running. This is useful for troubleshooting if you’re having PHP or mySQL errors.
  • If you’re adjusting the PHP settings in a .ini file, run valet restart, and then suddenly start seeing only an “It works!” screen where your site should be, you probably have to stop Apache first before restarting Valet. Most guidance online recommends running apachectl stop, but I had trouble with this (see related StackOverflow thread). Instead, I ran valet stop, sudo killall httpd, then valet start. This worked smoothly
  • Here’s a list of MySQL commands.
  • For more info about what $PATH is and why it’s important, see this Unix & Linux Stack Exchange thread.
  • I usually use redirect rules to use media from production when developing locally. Laravel Valet doesn’t seem to play nice with the normal .htaccess method, maybe because it’s actually an Nginx server. See “Proxying images to a remote host on Laravel Valet” for an effective alternative.

Edit 10 July 2019 – Added further notes based on working with Laravel Valet the past few days, including the PHP and Nginx config adjustments.

Nan-nan’s cupcakes

Looking through Nan-nan’s recipe books, the first thing that caught my eye was a recipe for cupcakes from her sister June, see below. I’ve preserved her notes and phrasing as much as possible but have adjusted certain elements to be more usable.

I’m an OK baker but more of a pies-and-cookies person. Every cake I’ve ever made seems a little meh. These were not meh, 10/10.


Cup Cakes

From June, Merle’s favorite. Good with baked icing or white fudge icing. Makes 12.

Preheat the oven to 350F (175C).

In a large bowl, cream together ½ c (113 g) softened unsalted butter, 1 c (200 g) sugar, ½ t salt, and 1 t vanilla extract until very fluffy and light. Next, beat in 4 egg yolks until thick and light in color. In another bowl, sift together 2 c (230 g) all purpose flour and 2 t baking powder. In small, alternating amounts, add the flour mixture and ⅔ c (158 ml) milk to the butter mixture. Beat after each addition, until smooth.

Pour the batter in to a lined cupcake tin, filling each cup ⅔ of the way. Bake in a moderate oven, about 350F (175C), 25 to 30 minutes. Turn the tin once halfway through if you find one side is browning more than the other.

Additional notes

Note that the cupcake recipe originally calls for Spry, a vegetable shortening. I’ve substituted butter here since that’s what I’ve got.

The original recipe also specified 2 c of sifted flour, with an additional note that specified Gold Medal or Swans Down flour. Gold Medal is usually plain / all purpose flour, and Swans Down only produces cake flour AFAIK. This made determining the metric measurement kind of ambiguous, 2 c sifted all purpose flour is significantly different than cake flour. The measurement below worked well ultimately, but I’d like to try cake flour eventually so will need to keep this in mind.

She originally said it makes 18, but I found that it is much closer to 12 in a 12-cup cupcake tin with cups that measured 2″ (4.25 cm) in diameter across the base. The flour debacle might have caused the difference.

The cupcakes supposedly go well with “baked icing”, something I had never come across before. I tried it with baked frosting and failed *spectacularly*. I can see that it could be great though, kind of like a molasses-y meringue on top, so I’ll try again and note here if successful.