Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]
47

WP Enqueue for Beginners

from Making software better without sacrificing user experience. [alt+shift+b] in programming

WP Enqueue for Beginners 2020-05-05 Throughout my career designing, developing and auditing WordPress themes, I've come across many that include their custom styles / scripts as static HTML elements inside their respective header and footer templates. This is perfectly fine, but there is a cleaner way to include these files. This post is purposefully catered for WordPress beginners, so if this seems overly simple, then you're probably already developing WordPress themes that utilize these techniques. (Which is awesome!) Introducing WP Enqueue The description of Wp Enqueue from the WordPress documentation: In a nutshell: Placing a wp_enqueue_script or wp_enqueue_style script in the functions.php of your custom theme tells WordPress to pull external files into the header or footer of your website. Best practice being: styles into the header, scripts into the footer. I suggest you read the official documentation for more details: wp_enqueue_script and wp_enqueue_style. Enqueue Stylesheets The default script to enqueue a CSS stylesheet: wp_enqueue_style( $handle, $src, $deps, $ver, $media ); $handle - the name associated with your stylesheet $src - URL pointing to the directory of the stylesheet itself $deps - An array of any other stylesheets needed as dependencies $ver - The version number of the stylesheet (used for cache busting) $media - Specify media type (all, print, screen, etc.) So, with all those parameters in mind, here is what a standard default enqueue of a CSS stylesheet looks like: wp_enqueue_style( 'google-fonts', 'https://fonts.googleapis.com/css?family=Montserrat:200,300,300i,400,600,700,800,900', '', '1.0', ''); In this example we have rendered the following: $handle: google-fonts $src: https://fonts.googleapis.com/css?family=Montserrat:200,300,300i,400,600,700,800- 0 $deps: Null (left blank) $ver: 1.0 $media: Null (left blank) Important: Keep in mind that the wp_enqueue_style script will render the stylesheet link into the WordPress header...
5th May 2020

Stay updated

Get a weekly newsletter with the top 5 articles worth reading every week.

More from Making software better without sacrificing user experience.

Bringing dwm Shortcuts to GNOME

Bringing dwm Shortcuts to GNOME 2023-11-02 The dwm window manager is my standard "go-to" for most of my personal laptop environments. For desktops with larger, higher resolution monitors I tend to lean towards using GNOME. The GNOME DE is fairly solid for my own purposes. This article isn't going to deep dive into GNOME itself, but instead highlight some minor configuration changes I make to mimic a few dwm shortcuts. For reference, I'm running GNOME 45.0 on Ubuntu 23.10 Setting Up Fixed Workspaces When I use dwm I tend to have a hard-set amount of tags to cycle through (normally 4-5). Unfortunately, dynamic rendering is the default for workspaces (ie. tags) in GNOME. For my personal preference I set this setting to fixed. We can achieve this by opening Settings > Multitasking and selecting "Fixed number of workspaces". Screenshot of GNOME's Multitasking Settings GUI Setting Our Keybindings Now all that is left is to mimic dwm keyboard shortcuts, in this case: ALT + $num for switching between workspaces and ALT + SHIFT + $num for moving windows across workspaces. These keyboard shortcuts can be altered under Settings > Keyboard > View and Customize Shortcuts > Navigation. You'll want to make edits to both the "Switch to workspace n" and "Move window to workspace n". Screenshot of GNOME's keyboard shortcut GUI: switch to workspace Screenshot of GNOME's keyboard shortcut GUI: move window to workspace That's it. You're free to include even more custom keyboard shortcuts (open web browser, lock screen, hibernate, etc.) but this is a solid starting point. Enjoy tweaking GNOME!

2nd Nov 2023 • 119 votes
Installing Older Versions of MongoDB on Arch Linux

Installing Older Versions of MongoDB on Arch Linux 2023-09-11 I've recently been using Arch Linux for my main work environment on my ThinkPad X260. It's been great. As someone who is constantly drawn to minimalist operating systems such as Alpine or OpenBSD, it's nice to use something like Arch that boasts that same minimalist approach but with greater documentation/support. Another major reason for the switch was the need to run older versions of "services" locally. Most people would simply suggest using Docker or vmm, but I personally run projects in self-contained, personalized directories on my system itself. I am aware of the irony in that statement... but that's just my personal preference. So I thought I would share my process of setting up an older version of MongoDB (3.4 to be precise) on Arch Linux. AUR to the Rescue You will need to target the specific version of MongoDB using the very awesome AUR packages: yay -S mongodb34-bin Follow the instructions and you'll be good to go. Don't forget to create the /data/db directory and give it proper permissions: mkdir -p /data/db/ chmod -R 777 /date/db What About My "Tools"? If you plan to use MongoDB, then you most likely want to utilize the core database tools (restore, dump, etc). The problem is you can't use the default mongodb-tools package when trying to work with older versions of MongoDB itself. The package will complain about conflicts and ask you to override your existing version. This is not what we want. So, you'll have to build from source locally: git clone https://github.com/mongodb/mongo-tools cd mongodb-tools ./make build Then you'll need to copy the built executables into the proper directory in order to use them from the terminal: cp bin/* /usr/local/bin/ And that's it! Now you can run mongod directly or use systemctl to enable it by default. Hopefully this helps anyone else curious about running older (or even outdated!) versions of MongoDB.

11th Sep 2023 • 81 votes
Converting HEIF Images with macOS Automator

Converting HEIF Images with macOS Automator 2023-07-21 Often times when you save or export photos from iOS to iCloud they often render themselves into heif or heic formats. Both macOS and iOS have no problem working with these formats, but a lot of software programs will not even recognize these filetypes. The obvious step would just be to convert them via an application or online service, right? Not so fast! Wouldn't it be much cleaner if we could simply right-click our heif or heic files and convert them directly in Finder? Well, I've got some good news for you... Basic Requirements You will need to have Homebrew installed You will need to install the libheif package through Homebrew: brew install libheif Creating our custom Automator script For this example script we are going to convert the image to JPG format. You can freely change this to whatever format you wish (PNG, TIFF, etc.). We're just keeping things basic for this tutorial. Don't worry if you've never worked with Automator before because setting things up is incredibly simple. Open the macOS Automator from the Applications folder Select Quick Option from the first prompt Set "Workflow receives current" to image files Set the label "in" to Finder From the left pane, select "Library > Utilities" From the presented choices in the next pane, drag and drop Run Shell Script into the far right pane Set the area "Pass input" to as arguments Enter the following code below as your script and type ⌘-S to save (name it something like "Convert HEIC/HEIF to JPG") for f in "$@" do /opt/homebrew/bin/heif-convert "$f" "${f%.*}.jpg" done Making Edits If you ever have the need to edit this script (for example, changing the default format to png), you will need to navigate to your ~/Library/Services folder and open your custom heif Quick Action in the Automator application. Simple as that. Happy converting! If you're interested, I also have some other Automator scripts available: Batch Converting Images to webp with macOS Automator Convert Files to HTML with macOS Automator Quick Actions

21st Jul 2023 • 56 votes
Running VSCode in Chromium on OpenBSD

Running VSCode in Chromium on OpenBSD 2023-06-05 VSCode and its many variations are not available on OpenBSD. This doesn't cause issue with many OpenBSD users, but those making the jump from Linux might miss access to such a popular editor. Lucky for us, there is a hacky workaround to solve this problem. VSCode in the Browser I tried my best to build something like code-server locally and run that directly in my browser - but I failed miserably. Instead, I fell back on vscode.dev which is essentially a remote version of code-server. Getting things to work seamlessly proved a little more challenging. I found the best performance was running everything through Chromium with special parameters enabled on launch. Note: The following assumes you have already installed chromium First we need to disable unveil for Chromium. This will allow us to access our system files through vscode.dev using the "Open folder..." or "Open file..." commands without issue: chrome --disable-unveil Everything should work pretty solid right out the box now - except it doesn't. Syntax highlighting does not work without enabling WASM/WebAssembly. Your experience might be different, but I had to include the following when launching Chromium from the terminal: ENABLE_WASM=1 chrome --enable-wasm Success! We can avoid typing out these complex commands everytime we want to launch our editor by setting up an alias (in my case via .zshrc): alias vscode="ENABLE_WASM=1 chrome --enable-wasm --disable-unveil" That's it! Now I can just pop open VSCode on OpenBSD by simply running vscode in my terminal. Hopefully this can help others slowly transition over to OpenBSD - which you should do because it is amazing!

5th Jun 2023 • 111 votes
Converting My X201 ThinkPad into a Slabtop

Converting My X201 ThinkPad into a Slabtop 2023-05-01 I recently wrote about physically disabling the WiFi toggle switch on my X201 which was a fun "hack" to an annoying issue I was running into. Since then, the laptop has been running flawlessly. The only other minor issue I had was the poor display quality. The screen works perfectly fine but the X201's age prevents it from being the best possible display for day-to-day tasks. Both the resolution and viewing angles are quite poor. So, what were my options to remedy this problem? Swap out and upgrade the laptop's display (not many options for this though) Connect an external display, keyboard, mouse and dock the X201 Something else? Looking into "Something Else" I found that the possible replacement screens weren't worth the cost/hassle to swap out. And setting the laptop aside, docked with external peripherals sounded fine in theory - but then I would be missing out on the X201's amazing classic keyboard... Then I thought to myself, "Why not just remove the display entirely?" So that's what I did. The X201 display (still inside the top lid) disconnected from the body of the laptop. Removing the entire top lid was easier than I initially thought it would be. The beautiful thing about these older, classic ThinkPads is the ability to completely dissemble them. I won't go into heavy details on how to take one of these machines apart, since great documentation already exists. But once you have the keyboard and hinge screws removed it is essentially as easy as lifting the lid out of the chassis. (After disconnecting the small display connectors, of course) Ditching Alpine for Debian I love Alpine Linux. It's normally my go-to distro (paired with dwm) for most of my laptop devices. Unfortunately, I find tiling window managers a slight pain to use on larger, 4K displays. I also wanted this slabtop to "just work", instead of needing to fiddle around with WiFi, xrandr, audio etc. Not to mention that Debian is rock solid stable. Defaulting to the XFCE DE was a no-brainer as well since this device is somewhat old. The X201 "slabtop" connected to my 27" 4K monitor via the ThinkPad UltraDock. Closing Thoughts This slabtop gives me those old-school "Commodore64" vibes (or more recent devices like the Raspberry Pi 400). This setup certainly isn't for everyone but for my use case it's working well. Traveling with a machine like this might prove a little more challenging - although you could simply pair it with a smaller travel monitor (I'm sure the overall carrying weight would be similar to the standard X201). If nothing else, it is good to keep this option in mind if you ever break your laptop's display and don't feel like spending the money to fix it. Just grab an external monitor you have laying around and make a slabtop!

1st May 2023 • 109 votes

More in programming

Not everybody is an AI expert - and that’s fine

This post was previously published through my newsletter on November 9, 2026. From time to time, I will republish newsletter issues on my blog here if I think people (and search engines) might benefit from it. If you want to read everything I’ve written once it is posted, I recommend signing up for the newsletter. If you’re doing anything to stay on top of what is happening in the world of software testing and test automation, like browsing or even posting on LinkedIn, which I stopped doing for the foreseeable future, or reading blog posts - my preferred way of keeping up these days, and I highly recommend Dawid Dylowicz’s excellent Software Testing Weekly aggregator mailing list if you prefer longer-form reading, too you’d be thinking that AI has consumed our entire field, and that everybody (or at least those who post or write in public) is an AI expert these days. The reality, though, is far from that. Yes, some people use a lot of AI, even when I would only call a small fraction of them ‘experts’. I definitely do not classify myself as an ‘AI expert’, by the way. A much larger group uses AI on a less frequent basis, and they’re getting some value out of it. Sometimes more, sometimes less. That’s the group I’m probably in. And then there’s a group of people who haven’t really been using a lot of AI at all so far, beyond maybe the odd prompt to ChatGPT or Claude. I don’t have the actual numbers, but I suspect that this group is a lot larger than you would think from browsing your feed or surfing the blogosphere. You just don’t see them, because they’re typically not the people who do a lot of work in public. A few weeks ago, I started working with a small group of testers to teach them how to use AI in their daily work. This work covers both test automation as well as broader software testing tasks, as some of them contribute to automation on a daily basis, but not all of them do. I’m working with them one day per week, on average, for three months, and we’re making small steps towards making AI a more prominent tool in their tool belt. So, what are we working on right now? I’m pulling ideas from my ‘Valuable Feedback, Fast with AI’ course, and so far, we’ve spent some time setting up Claude, going over some important concepts such as context windows, models, tokens, and (of course!) the probabilistic nature of LLMs, and what that means for the results they provide. We have gone through several initial conversations, using Claude to learn more about and review specific user stories, which was an excellent segue into using talking about MCPs and setting up a connection to both Jira and Confluence using the Atlassian MCP. Last week, we also started experimenting with writing straightforward skills to make it easier for Claude to repeat certain actions in a structured way. These actions ranged from reviewing stories and acceptance criteria to refactoring small chunks of code in their (Robot Framework-based) test automation suite. What I loved about this is the avalanche of ideas that popped up in their heads when they saw how easy it was to use Claude. We made a short to-do list of ideas to try out for the next couple of weeks, and I’m looking forward to seeing them getting more confident around using Claude. One thing I have noticed is that their level of comfort around using AI varies quite a bit. Some of them are naturally quite cautious, which means they’ll ask ‘can we really do this?’ and ‘should we really do this?’ frequently before even submitting a single prompt. This is a good habit, I think, but we’ll have to do some work to get them more comfortable with using LLMs, without losing too much of that caution. Others in the group are the opposite: I need to hold them back a little, because otherwise they’ll create a beautiful mess within days, simply because they see so many opportunities to use Claude in their work. That, too, isn’t inherently bad, but I do want to teach them not just how to get the most out of an LLM, but also (more so) how to use AI prudently. Over the next couple of months, we’ll dive deeper into writing better prompts, creating and structuring skills, better context management, and creating and using agents, and probably a few more things, too. I’m looking forward to seeing these people grow more comfortable around using AI in their daily work, and figuring out where AI genuinely adds value and where it doesn’t in their own context. Is there a deeper message in this newsletter? Maybe not, and I’m just happy to tell you about this project, and how it is a great example of a what I call ‘corporate mentoring’, a very efficient way of teaching a small group of engineers new skills, within their own context. But maybe it’s also to show you that, despite what you might see on the Internet, especially those places featuring a lot of self-congratulation (I’m looking at you, LinkedIn), not everybody out there is an AI expert. At least not yet. So, if you feel like you’re ‘behind’ simply because you’re not running at least 17 agents continuously, creating 5400 merge requests per day, know that you’re not alone. Quite far from it, I would say.

22 hours ago • 1 votes
Notes from CoRL 2026

(Tuesday)

2 days ago • 1 votes
The Codebase Rewrite is Back

The economics of software engineering have fundamentally changed.

2 days ago • 1 votes
How OCaml effects simplified my JSON interpreter

How effect handlers removed control-flow plumbing from query-json

2 days ago • 1 votes
Unattended reboots with encrypted disks

An introduction to ZKeys: a new service that stores encryption keys off-site and automatically locks access to them if the client machines go offline for a long period of time.

5 days ago • 1 votes
📚 BoredReading

You seem to be enjoying this.

Join free to unlock everything.

Create free account

Already have an account? Sign in