In React, each component can render only a single element. At the moment, there’s no way to return a multiple elements from a component’s render function.
However, if you need to render multiple components anywhere else, here are 2 solutions.
Returning Multiple Elements as an Array
It’s good practice to use helper methods or functions to generate part of your component. It’s common to want to return multiple elements from your helper method without a wrapper…

I recently switched to Windows 10 to use the new Windows Subsystem for Linux. After switching, I’ve found Windows 10’s built in Virtual Desktops to be very useful. Previously, I’ve used VirtuaWin for virtual desktops on Windows, so having it built-in is very nice.
However, the other GUI OSes I use, OS X and Ubuntu, both support swipe gestures to switch between desktops or workspaces. Therefore, I wanted to add swipe gestures for switching between virtual desktops on Windows 10…

What is progressive loading?
“Progressive loading” can mean many different things. Generally, it means partially loading something first, then loading the rest later. In this article, “progressive loading” refers to loading HTML in chunks.
PHP uses buffers to improve efficiency. Buffers batch up PHP output so your server can send fewer responses. Without buffers, your server would have to send a response each time PHP generates output (e.g. by calling echo)…

This article assumes you’re already familiar with the basics of callback hell, promises, and the Javascript event loop.
For the past few years, promises are rapidly becoming popular. They make it much easier to deal with complicated asynchronous code than callbacks. However, we can do better than promises.
Problems with promises
Promises have several issues that can make large applications difficult to understand, debug, and maintain:
You can’t abort a chain of promises
In this example, if we don’t want to run the rest of the promise chain, we use a throw to skip the processData…

I often get asked “which Javascript framework should I use?” My answer is usually “it depends, but probably React.”
jQuery
jQuery is a Javascript library that helps you perform common tasks in Javascript. jQuery used to be extremely useful because it standardized behavior across browsers. Different browsers used to behave slightly differently; jQuery made those differences go away. Nowadays, the popular browsers all behave nearly identically, so jQuery isn’t as useful…

If you’ve written enough Javascript, you’ll encounter this for sure:
Why wait for 0 milliseconds? Why not just call doSomething directly?
The answer is that this setTimeout isn’t telling the Javascript engine to run doSomething after 0ms. Rather, it’s telling the Javascript engine to run doSomething after at least 0ms. This is a key distinction for understanding how Javascript works. doSomething could run almost immediately or it could run seconds later…

Asynchronicity is arguably the hardest part of Javascript development. I’m assuming you’re already familiar with promises. If not, you can read about it and come back when you’re done. Understanding promises is crucial for modern web development.
Promises and RxJS
Promises solve Ajax callbacks very well. Remember the days when you had to handle multiple parallel Ajax requests with callbacks. How did you handle it if one fails? It probably wasn’t pretty…

To add a thumbnail to a post in WordPress, you need to manually add a “featured image” from the post editor. It’s possible to automatically use the first image in a post as the post’s thumbnail. Many themes do this automatically. There are also plugins that do this; one such plugin is Auto Post Thumbnail. However, if you don’t want to download a whole plugin, you can simply use the snippet below…

There are some plugins that are only used for specific pages on your blog. If you enable them globally, they will slow down the rest of your blog. WordPress doesn’t come with a built-in feature to conditionally enable plugins. I can’t even find a WordPress plugin that does this.
If you want to enable a WordPress plugin for just a single page, add this snippet to your functions.php:
For example, I’m using The SEO Framework as my SEO plugin…

WordPress has pretty good on-page SEO by default, but an SEO plugin will help make it even better. SEO plugins let you customize your title format, add social media meta tags, add structured data, and lots more. Here are 4 of the best WordPress SEO plugins.
Yoast SEO
Yoast is the most popular WordPress SEO plugin and it was the standard SEO plugin that everyone used and loved. However, I find that Yoast is bloated with features that I don’t need…

APC consists of 2 parts: opcode caching and memory caching. PHP 5.5 and newer have built-in opcode caching, so APC is no longer supported. A new PECL package, APCu, was created for the memory caching part. The prefix for APC memory caching functions changed from “apc” to “apcu”. For example, apc_store became apcu_store and apc_fetch became apcu_fetch.
APCu Backwards Compatibility
Some plugins, such as W3 Total Cache, are still using the apc_* functions…

Today I installed Query Monitor and noticed that each post on my homepage was triggering 2 database queries. One query retrieved the post_tag post taxonomy and one retrieved the post_format post taxonomy. Since my homepage has up to 15 posts, there can be 30 extra queries. These values should have been fetched all at once; they should not be fetched from the database individually.
I disabled my plugins one-by-one and realized that the issue was caused by W3 Total Cache…

Favicons are the icons displayed on browser tabs. They help form the identity and brand of a WordPress blog.
App icons are a way to help bridge web apps and mobile apps. On popular mobile browsers such as Chrome and Safari, you can add shortcuts to webpages on your homescreen. These shortcuts look like apps, but they’re essentially bookmarks. Mobile browsers use your blog’s app icons as the icons for these shortcuts…

WordPress allows you to write comments on media attachment pages by default. Since attachment pages contain only the attachment, it’s unlikely that people will write comments on them. The snippet below disables comments on attachment pages:
If $is_open is already false, this doesn’t fetch the post…

WordPress’s TinyMCE editor makes all links use absolute URLs with your blog’s siteurl as the base. Your blog’s siteurl is the value in Settings > General Settings > WordPress Address (URL). This value is hardcoded in your posts. This means that if you change your domain, change your permalink structure, or switch from http to https, you’ll have to update your posts. Also, you cannot support both http and https; you have to choose one…