WWW posts

Web development, my site, server, career, programming, the world wide web, and related topics

I don’t use npm often. When I do, I tend to be reminded of annoyances in using it. One such annoyance is that it doesn’t take into account the node version in use when installing new packages, as I posted about four years ago. It just goes with the latest if no version is specified, regardless of its ability to run in the available environment. So I have to manually step back versions until I find one that works. The alternative package manager yarn at least has the good grace to error out for incompatible versions, so I used that and just decremented the version of each package until it stopped erroring.

Some of us like to let our OS package manager manage our OS-wide software for security, stability, and simplicity, and that isn’t always the latest and greatest.


Symfony templates for WordPress pages

I’ve been using Symfony for all of my site pages except the blog, which is run with WordPress. Originally I was using a standard WordPress theme that made my blog look different than the rest of my site. I had looked into ways to pull WordPress through a controller action and stuff like that, but ran into difficulties. I ended up using a solution where WordPress functions as normal for the subpath that it is in, but code in a custom theme boots the kernel from the Symfony part of my site and uses the twig service to render the template. Output buffering is used to capture the normal output of the site to pass to twig.

My theme code does some other things, but I will try to present a stripped down version that could work with a Symfony Standard Edition site for the purposes of this post to hopefully help others do the same.

Continue reading post "Symfony templates for WordPress pages"

Updated to Symfony 6.4

Since updating my server earlier in the year, and thus moving to PHP 8, I would’ve been able to update to Symfony 6. I didn’t get around to it until today, though. I’ve been fixing deprecations in my code mostly as they appear (in profiler, console, logs, or automated tests) so I didn’t have a lot to do this time. I changed ^5.4 to ^6.4 in my composer.json and then had to adjust a few minor things in config. Some of those took longer than they should’ve though.

Continue reading post "Updated to Symfony 6.4"

Ghosts.js

A few years back, to make my site more festive for Hallowe’en, I made a script to have ghosts move around my web-page. I based it on my snow script for winter / Christmas, using the basic structure, reducing the number of moving objects, and changing their movement to look better for ghosts. I meant to post about it. This year I decided to break it out into its own Github repo, which led to me refining it and cleaning it up somewhat. See the ghosts.js repo and the ghosts.js demo.

Continue reading post "Ghosts.js"

h5bp links

Earlier in my career, I looked to the HTML5 boilerplate for ideas on how to set up websites. I just grabbed bits I liked and modified them as needed. For a time they had shortened links off of the h5bp.com domain that redirected to descriptions of why certain choices were made. But eventually, the person maintaining that domain let it lapse and someone else bought it.

Continue reading post "h5bp links"

Sequel Ace

I finally moved from Sequel Pro to Sequel Ace. Sequel Pro hasn’t been updated in years. It mostly worked but did have some annoying problems. During a recent OS and app reinstall, I found that Sequel Pro was no longer available on Homebrew, so I went for Sequel Ace, a fork that is still maintained. It is very similar but improved. I like it.

Continue reading post "Sequel Ace"

JS: Replace page text

For this year’s April Fools Day, I decided I wanted to replace some text in the content of my site’s pages to something funny, weird, or confusing. Since I’m moving toward a static site, I wanted to do this client side, which meant replacing text with JavaScript. This would be simple with innerHTML, but that completely replaces the DOM with a new DOM, possibly causing usability and performance issues, and could replace text in URLs, breaking them. Probably a better way is to loop through all nodes on the page, looking for text nodes, and replace text in each of those. So I did this, and it worked nicely. Thought I’d share.

Continue reading post "JS: Replace page text"

</toby>