Over the past couple weeks we've actual had 3 releases of this library which bring us now to stable version 1.9.0. Together these releases have included a few new features as well as stability enhancements. Further streamlining of Ajax testing: Back in version 1.6.0 we introduced the ability to test custom ajax responses with a new helper method called _handleAjaxCustom. While this works great, it still requires the boilerplate of a try/catch block then using $this->_last_response. … [Read more...]
Category: Programming (page 5)
Introducing – Use Immer ReactN
If you have been part of the modern JavaScript community, it is likely you have run across a handy library called Immer. While I won't go too far into detail about what Immer does, the gist is it allows you to mutate immutable objects and pass the changed objects back as a new immutable one. This certainly comes in handy when dealing with React state which works almost exclusively with immutable objects and expects new ones to be passed for state updates. It is equally as likely you have run … [Read more...]
Case Study: Displaying Highlighted Search Terms With Limited Content
As the content of a WordPress site grows (using this site as my case study) search results will also grow. Typically on a WordPress site the search results will either show the post content, the excerpt, or a limited version of the content. WordPress does not highlight the words in the content which match the search terms, nor does it automatically display the relevant sections of a post's content when using the excerpt or a limited version of content. This can lead to potentially unintuitive … [Read more...]
Node As A CLI
This is an exhaustive article on creating command line run scripts/executables with node and how it all works. It is broken into sections for convenience if you are looking for a specific topic. Otherwise, grab a coffee and prepare to learn more than you ever wanted to know about node cli. For the purpose of this article the words package and project are interchangeable and both mean a node app which is defined by the package.json standard. For the purposes of this article all project … [Read more...]
Responsive Image Srcset Sizes
So you are using WordPress right? Or maybe another modern CMS which supports responsive image srcsets? Alright, so you are a true pioneer rocking your own framework? Regardless of how your images get those helpful "srcset" attributes, this article will apply to you. Real quick refresher... the srcset attribute allows your browser to select the appropriate image src based on the current screen size and pixel density. This way you can load retina images or smaller versions depending on how you … [Read more...]
Going Codemirror
A few years ago (2015) to be exact, I needed a way to to be able to highlight some code on my website. At the time I was writing example filters for my free plugins with the developer docs pages. I went to the community to see what I could find and came up with a plugin called WP-Syntax. This plugin had a few shortcomings so I ended up creating and maintaining a fork or it (which admittedly I often do with any 3rd party code I use) WP-Syntax allowed for adding special <pre … [Read more...]