Avoid console errors in browsers that lack a console

I love JavaScript and code a lot in it .Since I code, I also encounter problems and bugs from time to time and therefore need a Debugger and a debug mechanism to view whats going on.

In the good old days when I learned this language, I used JavaScript’s inbuilt alert mechanism to view the value of a variable or a property of an object. This was a terrible mechanism, calling alert was blocking, one had to press OK to continue and if you had to take a look inside an array then well it was emotionally an overwhelming task is all I would say here.

Read more →

sqlite3 Bulk Import CSV from command line

I absolutely love SQLite, be it windows, linux or mac, this lightweight database never stops to amaze me.

A few days ago I wanted to import a chunk of CSV data, which was 4 GB in size into a table in SQLite.

I generally use Firefox ’s sqlite-manager plug-in for usual tasks with SQLite database ,hence decided to use the import interface.

I have had a very good experience with this GUI tool and it has rarely failed me, but this time I was disappointed.

Read more →

Position div in the center of the page using css

When I first started web programming, creating a center aligned div was one of the most common tasks that I saw myself doing.

Since a div is a block element, i.e. it takes up the full width available, and has a line break before and after it, it can easily be centered using relative styling

{
margin-left:auto;
margin-right:auto;
width:70%;
background-color:#b0e0e6;
}

However lately I have preferred using absolute positioning technique over relative, this works for all browsers and is best for login screens or alert messages over a translucent shim.

Read more →

A guide to hosting in Red Hats OpenShift PaaS

In this post, I am going to write about OpenShift, which is Red Hat’s free, auto-scaling Platform as a Service (PaaS) for applications.

OpenShift to me is very similar to Google’s app engine in some ways, but openshift’s offerings are quite diverse, for instance support for ruby, php, Perl, node.js, etc..

Openshift is not like a traditional VPS hosting, although once registered with them, the user does get shell access, but its quite limited, instead OpenShift has a concept of gears and cartridges.

Read more →