Resume bash script after reboot

I often write bash scripts to automate common tasks in my projects. Often the script makes changes that requires a reboot. And when the machine finishes rebooting the script needs to resume from where it left. Following script creates a temporary file that we use as a flag in the script to check if the script is resuming from reboot. We also temporarily update the .bashrc or .zshrc to trigger [Read More]

Setting up Laravel with Docker : Part 1

Laravel is one of the most popular PHP framework available right now. In this post we will set up laravel application using Docker. Docker enables independence between software application and the infrastructure by enabling containerization of the platform. Docker is available on most of the operating systems. Download and install the appropriate version of docker for your operating system from Docker Store. Verify the installation by going into the terminal [Read More]

Vim style copy paste in Tmux

Tmux is a terminal multiplexer which allows us to create and manage multiple terminal windows. In this article we will configure tmux to have vim style copy and paste. [Read More]

Remove switch statements using polymorphism

In this post we will use polymorphism to remove switch statements. Inappropriately using switch statements is a sign of code smell. Robert Martin in his book Clean Code says that he limits himself to one switch statement per object type. We will use example of a Customer class. Initially we will use switch statements to implement the methods of the class. Then we will use polymorphism to refactor it and [Read More]

Android clean architecture

One of the primary goal of building software is to meet the business goal. Weather it be a simple shopping list application or a large banking application, they exist to solve a problem. As the software grows in functionality it need to be able to cope with changing business requirements. Well written software can accommodate changes quickly without affecting other parts of the application. With the growth of software many [Read More]