Building a Resilient Continuous Deployment System

When was the last time a single developer did something really small and it made big impact? You can list them out or you can read it on Verge, BusinessInsider and on TheRegister. In a nutshell, Azer decided to unpublish left-pad, an 11-line NodeJS module on NPM, and it broke thousands of other NPM module installations that depended on it.

The impact of the absence of left-pad was felt mainly by services having a continuous integration or a continuous deployment system. I can but imagine the countless hours developers had to spend to patch up their CI/CD to prevent or fix a service outage.

The fact remains that our endeavour to deliver software quick and dirty is what has left us vulnerable. Vulnerable to a point where it is both disconcerting as well as lame

Continue reading “Building a Resilient Continuous Deployment System”

Get your bash scripts to sleep (halt execution) on Shippable and Travis

As I write this, it’s been about 36 hours without sleep for me — enough to relate to the importance of sleeping. However, this discussion is around getting a bash script or JavaScript on NodeJS to sleep for a specific duration.

#!/usr/bin/env bash

echo "Feeling drowsy...";
sleep 10;
echo "Woof! Back up after 10 seconds!";

The sleep command in unix allows one to pause execution of a script for a specified duration. It is a very handy tool in times where a script needs to wait for some other asynchronous work to complete. (Kindergarten talks for many!)

Continue reading “Get your bash scripts to sleep (halt execution) on Shippable and Travis”

Postmortem of a UI repaint issue on Chrome

A while back, a section of our users started reporting a UI rendering issue while using Postman. The interesting thing about the issue was that it occurred only on very high resolution monitors. High resolution to the tune of 2k, 3k displays and above (such as Macbook Retina displays.) As such, full HD users did not face this issue. Having said that, it was quite annoying for the ones facing it.

Intermittently, parts of the UI would not redraw itself for no reason whatsoever and usually resizing the app window would fix it momentarily. There was no predictable way to reproduce the issue and nor did we discover the root cause of the issue. The screenshots submitted by our users were the only starting point we had.

Continue reading “Postmortem of a UI repaint issue on Chrome”

Upgrading to Raspberry Pi Model B+

Often my OpenELEC Raspberry Pi would get stuck at pre-boot. The culprit turned out to be a faulty SD card connector. Unclipping the connector pins (as suggested in the elaborate diagnostic wiki on and soldering on an alternate low-profile SD card adapter (that I ordered from fixed it.

By that time, I had already ordered the new Raspberry Pi Model B+. My first impression – this is how the original Model B should have been designed!

Continue reading “Upgrading to Raspberry Pi Model B+”

Check if UNIX Path has Hidden Directory or File

This snippet of code uses regular expression to test if a path string contains any hidden directory. The use-case was derived from the difficulty in determining whether directory is hidden or not using NodeJS path module. Owing to the possibility of their existence within a long path string, this function returns false if any directory or the terminal file of a path has a name that starts with a dot.

 * Checks whether a path starts with or contains a hidden file or a folder.
 * @param {string} source - The path of the file that needs to be validated.
 * returns {boolean} - `true` if the source is blacklisted and otherwise `false`.
 * @example
 * console.log(isUnixHiddenPath('~/documents')); // prints `false`
 * console.log(isUnixHiddenPath('~/documents/file.txt')); // prints `false`
 * console.log(isUnixHiddenPath('~/source/repo/.gitignore')); // prints `true`
 * console.log(isUnixHiddenPath('~/source/repo/.git/config')); // prints `true` 
var isUnixHiddenPath = function (path) { 
    return (/(^|./).+[^/.]/g).test(path); 

A relevant StackOverflow question is located at and a gist is at

Knight in Rusted Armour

Stands stooped the knight
Adorned by the faintness of darkness
Covered by the mist of silhouette
And the gleam of golden dust. 

The next daybreak stands far away
And what lies ahead is the deception of dawn
Shadows cast from the vantage of clouds
Revealing the scars of the untold wars. 

Riding upon the moonbeams of agony
His sword had bathed times to a halt
His eyes being the shining glory
Of dreams that are seldom bought

Through the forests he strode
His fears riding his feats of glory
His triumphs leading his way to ditches
With his legends of unwritten stories. 

Whenever he stopped and rested his body
Bereavement was bestowed upon his kins of spear
Where his mind would scamper off to fields
Where truth was but an ally of fear. 

There he stood, lifeless and in pain
His agonies chiseled on to the horse he rode
The armour dropped loose from its lock
Rusted not by age but by faintness of war.

A mentally costly experience of buying a lounger

Beware: Owner wouldn’t think twice before fleecing money from you. If you’re a sharp person and not easily fooled, try your luck.

The above was my original review on Google Plus. The owner called me up on seeing the review and asked me to remove it since in his opinion, nothing had gone wrong. As such, I am doing a follow-up on the review here.

Continue reading “A mentally costly experience of buying a lounger”

Quick Validating JavaScript Function Before Call

There are many instances where we have to execute a function where we have no idea whether it actually exists or not. Let’s say for example, a function expects another function passed to it as parameter, which would later be executed as callback. A very common usage would be the callback function sent to AJAX requests.

Generally, we would code it with an if-block and check whether the variable (say, callback) is a function or not. If it is, we execute it when we have the work completed (say marked by a variable called workIsDone.)

Continue reading “Quick Validating JavaScript Function Before Call”