PHP doesn’t let you define typed arrays. Any array can contain any value, which makes it tricky to enforce consistency in your codebase. Here are a few workarounds to help you create typed collections of objects using existin…
JavaScript arrays are data structures which let you store multiple values under a single variable name. Arrays are a type of object. They come with several utility methods you can use to manipulate their data….
Docker lets you quickly package your applications as containers, making it possible to run them anywhere from your laptop to a public cloud. After using Docker for a while, you can accumulate a large number of redundant conta…
Setting resource limits on your Kubernetes pods prevents an errant container from impacting other workloads. Kubernetes lets you cap resources, including CPU and memory consumption. Pods can be terminated when their limits ar…
Docker usually provides a developer’s first introduction to containers. Kubernetes is an orchestration platform which solves challenges around running containers in production. Here’s how Docker commands map to their Kubernet…
React’s declarative rendering approach lets you quickly write rich components combining layout, presentation, and logic. However, it can make it more complicated to conditionally render UI sections. Here’s a few methods you c…
Covariance and contravariance are terms which describe how a programming language handles subtypes. The variance of a type determines whether its subtypes can be used interchangeably with it.
Redux simplifies state management in complex applications. As the Redux store contains your app’s entire state, persisting it lets you save and restore the user’s session.
Flameshot is a powerful screenshot tool for the Linux desktop. You can capture and annotate screenshots using intuitive tools. Finished images are copied to the clipboard, saved to your filesystem or uploaded to Imgur….
The File System Access API is a new browser feature that lets websites and apps directly interact with your device’s filesystem. There is now partial support for the API in recent Chrome and Opera versions….
Refs are a React feature which let you directly access DOM nodes created by a component’s render() method. They provide a way to break out of React’s declarative rendering so you can call browser APIs….
ES6’s finalization in 2015 brought new ways to define JavaScript variables. The let keyword creates a block-scoped variable while const specifies an immutable value. Here’s the lowdown on how these modern variable types diffe…
iSH is an active project to run a Linux shell on iOS. It offers an Alpine Linux environment, complete with the apk package manager. The app relies on usermode x86 emulation.
PHP allows you to create iterable objects. These can be used within loops instead of scalar arrays. Iterables are commonly used as object collections. They allow you to typehint that object while retaining support for looping…
Kubernetes is a container orchestration engine that lets you deploy containerised workloads in a scalable way. The official command-line utility, kubectl, provides control over your clusters and the resources within….
Dependency injection is a software engineering technique where objects are passed instances of the other objects they depend on. Instead of reaching to fetch outside dependencies themselves, objects should directly receive ev…
An arrow function in JavaScript is a terser alternative to a traditional function. The syntax enables quick creation of inline anonymous functions.
GitLab’s Container Registry provides a convenient place to store your Docker images. Over time, the Container Registry can eat up your disk space as more layers are added. Here’s how to free up storage by removing redundant m…
Monitoring your cloud resources lets you stay ahead of demanding workloads. DigitalOcean’s droplets benefit from versatile built-in reporting options that give you visibility into your usage.
JavaScript developers are familiar with the humble console.log() function. Although console logging may appear straightforward, there’s much more available within the console object. Let’s look at how you can enhance your log…
DigitalOcean provides an API as an alternative to its web-based cloud control panel. The official doctl command-line client offers an intuitive wrapper around the API. You can administer your DigitalOcean resources using an e…
Containerising your projects with Docker simplifies the development experience and facilitates straightforward deployment to cloud environments. Let’s look at how we can package a React site as a Docker container….
DigitalOcean droplets come with a limited amount of SSD storage. Here’s how you can add more disk capacity without breaking the bank, using DigitalOcean’s dedicated storage solution.
Using third-party packages can accelerate your project’s development. Sometimes, you might need to add extra functionality or fix a critical bug. Here’s how to apply patches to PHP packages installed by Composer….
Constructor property promotion is a new PHP 8 convenience feature which helps you minimise code repetition. It lets you combine the definition and initialisation of properties into a single constructor statement….