Posts

Applied Rails: An Algorithmic Perspective

Image
The Human Resources manager informed that employees working in the corporate headquarters (CHQ) will have the second and fourth Saturday of the month off. This affected the leave balance calculation method in my Rails application. If a CHQ employee applies for leave and a second or fourth Saturday falls in between the start date and end date, they should not be deducted a leave. I was already using the Rails date library. Given a date, I could get the beginning of the month and end of the month in which the date occurred. Before I could figure out how to proceed with this info, I went to stackoverflow.com and put up a question[1].

Applied Rails: Bulleted Text With Prawn

Image
I use the prawn gem to generate pdf documents in my Rails application. It has a drawback that it does not have built-in support for displaying bulleted text. So I wrote a simple function that took a string parameter and printed it with an indent and a leading asterisk.

Applied Rails : Customizable Text

Image
I got a requirement in my Rails application in which the user would add a set of "Terms & Conditions" in the Offer screen. These are typically standard, but the user should be able to customize the individual clauses. It sounded oxymoronic, but remembering Scott Meyers' words, "pretty this ain’t, but sometimes a programmer’s just gotta do what a programmer’s gotta do," I set out in right earnest to figure out what can be done.

Applied Rails : Variable Rows For Child Records

Image
I got a requirement in my Rails application to give the user the ability to input a variable number of records with multiple fields. The fields were of text type as well as select comboboxes. These rows had to be saved to the database as child table rows.

Welcome 2017

Image
First blog post at the beginning of the year, as was last year's, is a quantified compilation of my personal activities outside of my day job.

Book Review : Everyone Has A Story

Image
The novel 'Everyone Has a Story' by Savi Sharma is structured on the classic three acts of a romantic story: lady meets man, man goes away from lady and lady gets man back. Lady's goal is to become a writer. It was a breezy read for me and appealed to me as a record of the good-heartedness in people.

Steps And Commands For RoR Application Deployment On Linode Server

Image
I deployed my Ruby-on-Rails application on a cloud server. About a couple of years ago, I got into this practice of hosting my applications on the cloud. At that time AWS did not offer Ubuntu machines. I love Ubuntu so I did not go to AWS. I also have this feeling that access and deployment procedures on the biggies (AWS and Azure) are slightly more cumbersome than the not-so-biggies. Amongst these, Site5 is the cheapest but I don't get root access and was very disappointed with their lack of support. For $20 a month, I got a 4 GB RAM server on Linode compared to 2 GB RAM on Digital Ocean. Hence I went with Linode.