Lessons Learned With Integration Work

I recently worked on doing integration work with external LMS system. This article captures my experience and findings.

March 31, 2023 · Sinaru Gunawardena

How mock modules while overriding specific methods in Jest

Mocking specific methods in Jest.

July 24, 2021 · Sinaru Gunawardena

Getting a remote PostgreSQL database backup via SSH tunnel

In this article I’m writing a way to retrieve a backup of a PostgreSQL database in a remote server when you have access to the server machine via SSH. This would come handy when you can’t directly connect to the database server from your local machine. For example, in a situation where the PostgreSQL server only listens to localhost for connections or there is firewall preventing you from accessing the database port on the server machine....

February 13, 2021 · Sinaru Gunawardena

Problems with HTTP interceptors for browser redirects

At work I was debugging an issue that was coming from one of the Vuejs components and it was registered on Airbrake. The error indicated that a value we expect to have in one of the Vuex storages was not there. Architecture wise we have an initial boot process that run on page load and add the values to the storage. If this succeeds, then we create the main Vuejs app component to have a reactive web app....

January 26, 2021 · Sinaru Gunawardena

To use 404 code or not

At work I’m working on implementing REST based API end-points to expand the functionaity of the front-end application. Recently I had a discussion with one of the developers in the team about what HTTP error should be used when something that is expected to be present is missing due to some inconsistency in the server. Suppose you have a resource type called File Resource. Let’s assume that we have two endpoints for this:...

January 23, 2021 · Sinaru Gunawardena

Things to consider when upgrading Rails

Recently at work I had the opportunity to upgrade Rails from 4.2 all the way to Rails 6.1 for one of the core applications. With the experience, In this article I’m discussing some important points to consider when you are upgrading Rails. ...

January 2, 2021 · Sinaru Gunawardena

Fixing missing NVM Node for RubyMine

I have Rubymine installed locally. Recently for work, I had to install NVM in a new machine. However when I then load Rubymine on this new machine and start a task such a Rails project using the Configuration pane, I was treated with following error .../.rvm/gems/ruby-2.4.10/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) ... So basically it can’t find the NVM JavaScript runtime....

September 4, 2020 · Sinaru Gunawardena

An intro to Debugging

In this article I’ve gathered my thoughts to help developers to get better in debugging especially if they find debugging really hard. The article also lists a set of tools which will help them to debug efficiently and to improve their skills. Hopefully you will find some value in this article, if you are also looking for debugging advice. ...

July 20, 2020 · Sinaru Gunawardena

An approach to use service workers to replace load balancer

In this article, I’m going to discuss a novel way to distribute network load of a highly distributed web based application service. ...

July 15, 2020 · Sinaru Gunawardena

Serving Flask app with Nginx

So you have build a Flask application and now you want to server the application in the web. In this tutorial, I’m going to teach how you can do that with Nginx on an Ubuntu platform. ...

July 10, 2020 · Sinaru Gunawardena