TypeScript offers the ability to pepper one's code with type annotations, allowing the compiler to perform type checks and the language server to provide code completion. These all add up to an improved developer experience, but much of the benefits are thrown out the window once the code is shipped and running out in the wild. While TypeScript may encourage writing safer code that handles edge cases better, there are times when the need to perform runtime validations of values with non-trivial structures arises. This is typically the case when handling input from external sources, be that receiving a response from an API or from a user filling in a form.
Pushing a change to multiple git repos, while probably not something you would want to do in most cases, does not have to be a multi-step process. A fairly simple adjustment to the git config can enable pushing to multiple remote repositories with a single command.
Media queries are a vital tool in making websites responsive. This typically involves increasing/decreasing various properties' values in a step-like manner (e.g. bumping the font-size up by a few pixels at particular breakpoints).
Using a preprocessor allows us to cut down on the amount of boilerplate. We could pass breakpoint-value pairs to a mixin that generates media queries with the property set to its corresponding value. In this instance, we will limit the number of breakpoint-value pairs to two, and smoothly scale the value between the two breakpoints.
The prompt is, depending on how heavily one's workflow involves using CLIs, a potentially frequent occurence in a developer's workflow. It is worth knowing how the prompt can be customised to behave in a way that is more conducive and relevant to a given context.
This guide covers how to set up a WiFi hotspot on Linux using a single adapter. The scenario it aims to solve is one where only one device (for instance a laptop) is connected to a WiFi network that has a whitelist of permitted MAC addresses. The connected device can then be used to create a hotspot that other devices can connect to for internet access.
This guide goes through the process of setting up Azure CDN on a custom domain. A function is triggered when content is uploaded to Azure storage, and sets the time-to-live of the uploads based on what container they are uploaded to.
At times, we may need to keep certain files off a particlar repo. Usually a .gitignore file would suffice. But what if we want those files to be present in another repo? How do we go about setting that up? I will present a short method that tackles this problem.
When commiting any changes using Git, it is important to include relevant and well constructed commit messages for other developers – as well as your future self – who may be involved in the project. In this guide, I will discuss how to go about formatting git commit messages.
Git and Heroku are vital tools in any web developers repertoire. Git for the simplicity it introduces to version control, and Heroku for the ease with which it allows app deployment. The following is quick-start guide to get you up and running.