Blog
How to download an HTML5 canvas as an image using JavaScript
After drawing to the canvas, you may want to download and save the canvas drawing as an image. To do this, you can use the toDataURL() method of the canvas object. Suppose you have a button with id downloadBtn in an HTML file: The download and save…
Learn HTML5 canvas by building an image watermarking tool
HTML has come far from being just a markup language. The HTML5 canvas gives us the power to create and manipulate pixels, sort of like a painter working on a canvas. We can draw text and graphics onto the canvas using JavaScript. To demonstrate the power of…
9 UX writing tips for designers and developers
UX writing is the practice of crafting text for digital interfaces that help users interact with products more conveniently. While it is not expected for designers and developers to be professional writers, knowing how to write UX copy is valuable when…
JavaScript regular expressions crash course
Regular expressions are a method to describe patterns in string data. Regular expressions form a tiny, separate language part of many languages, including JavaScript. Admittedly, regular expressions have a cryptic syntax and are often difficult to write…
Predictive modeling of weight changes using differential equations
Inspired by my own challenges with weight fluctuations, I wanted to explore how people's weight might change based on calorie consumption. This article details how I went about modelling weight change with differential equations, and building a web application…
How to calculate the distance between two locations using JavaScript
The most popular way of calculating the distance between two points on a sphere is using the Haversine equation. If you have the coordinates (that is; longitude and latitude) of the the starting and destination locations, you can use this equation to…
How to get a someone's location using the Geolocation API
Knowing a user's location can be a very important feature of a web app. You can use the location information to personalise the user experience, give users directions, suggest friends or events in a person's locality, or to power a particular feature…
Advantages and disadvantages of SVG
Created in 1999, SVG has grown to become the most popular vector image format for the web. This article will cover the advantages and disadvantages of SVG (Scalable Vector Graphics) as a format for displaying images on the web. By knowing the pros and cons of…