Posts

It's Almost 2021 & Meteor Is Still Alive

Apparently, rumours of Meteor.js demise have been greatly exaggerated. Back in March 2020, the Meteor team released version 1.10 which saw a plethora of updates to the universal app platform. Admittedly, it has been quite a few years since I have worked with Meteor. I remember trying it in the early days and being wowed by its ability to allow you to build applications that bring the front and back-end together without needing to configure anything.

How To Create An Iframe and Populate It With Dynamic HTML In Javascript

At work recently, I had a use-case where I needed to show a preview of some HTML dynamically sent from the server inside of an iFrame. It is quite possible before you found this blog post, you found a solution that looked something like this: iframe.src = 'data:text/html;charset=utf-8,' + encodeURI(html); This will work for simple HTML and instances where the HTML isn’t overly long. But, if your use-case is like mine, the HTML the server is returning is massive. In my case, I had base64 encoded images making the returned HTML huge.

Should I Use Firebase?

I have been a Firebase user for quite a few years now, since 2016. In that time, I have seen Firebase grow and change as a product. I have also seen the problems people have had with it, as well as the successes. Googling opinions on Firebase will yield mixed results. Some are for Firebase and its all-inclusive platform offering features like authentication, a NoSQL database called Firestore, storage, hosting, Firebase Functions (basically AWS Lambda, Google Cloud Functions). Others advise against Firebase because of issues around costs and how the use of resources (reads and writes) are counted.

Waiting For Elements To Exist In The Dom With User-specified Attempts

I had to implement some testing logic recently where I wanted to wait for a heavy page to load and for specific elements to become available. I knew I wanted a function that polled the page and returned true if it found the element or rejected if it didn’t. I actually looked some a pre existing solution and turned up a blank. There are code examples out there, but some developers have created some over engineered solutions using things like proxies, mutation observers and other convoluted ways of waiting for elements.

Working From Home Is The New Normal

The 2020 COVID-19 pandemic really turned the world on its head. Despite the fact people have lost their jobs, businesses have been hurt, airlines are struggling and tourism has taken a nosedive, many of us have been fortunate enough to keep our jobs and work from home. Many large tech companies have already announced permanent changes allowing employees to work from home indefinitely. Twitter, Square and Facebook being some of the biggest who have announced changes.

How To Handle Async/Await Errors in Javascript

Some developers are still new to async/await in Javascript. If you’re used to callbacks or using .then to get the value of a promise, async/await can be a bit of a black box, especially when it comes to errors. The most straightforward and recommended way to handle errors is using try/catch. This will allow you to catch errors if your async function rejects or throws an error. async function getProducts() { try { const response = await fetch('/products'); const products = await response.json(); } catch(err) { console.error(err); } } If you had a function which handles API requests, you could do something like this:

How To Copy A Public and Private Key From Windows Linux Subsystem Terminal

In WSL (Windows Subsystem for Linux) you get access to a Linux terminal right inside of Windows 10. For the most part, it works great. However, when it comes to copying and pasting the contents of files from Linux into Windows, the option is obscured. You can right-click the toolbar on the WSL terminal window, go to properties and enable the copy and paste features if you’re on one of the latest versions of it.

How To Optimise Microsoft Flight Simulator 2020 Including CPU Performance Issues

If you are like me, you do not have the world’s most expensive and powerful gaming PC. When Microsoft Flight Simulator 2020 was announced, I was excited like a kid on Christmas. While my machine allegedly falls somewhere in the medium performance category, admittedly, the performance has been anything but smooth for me playing the game. Through trial and error, I’ve struck a good balance between the game not looking like Minecraft and not running like a potato.

How To Use Autonumeric.js With Aurelia

As a long-term user of the InputMask plugin, I’ve long put up with its downsides such as issues around negative amounts and decimals. Recently, I was tasked with integrating Autonumeric into an Aurelia application at work and the result was simple and elegant, I thought I would share it. The result works out a lot nicer than InputMask which I personally find to be an absolute nightmare to work with for currency scenarios especially.

Revisiting My Open Source Ideas From Six Years Ago

Six years ago I open-sourced some ideas onto Github I had floating around in my head. The web has changed a lot in six years, so I thought I would revisit my ideas and see what was good and what wasn’t. Massive Cryptocurrency API The idea was simple, an API for sending and receiving cryptocurrency payments. While Coinpayments was listed as a previous competitor, nobody else that I know of came to the table with a solution that has survived into 2020. Coinpayments is all but the standard for crypto payments now.