Himanshu Gilani

Web Developer and Entrepreneur. Founder of mementodb.com

Scripting Google Analytics: Part 1 - Tracking Pages and Events

| Comments

Google Analytics is a free web analytics tool from Google that you can use for tracking website statistics like page views, traffic sources, audience information, goals, funnels, etc. While a lot of the stuff is tracked automatically, it becomes overwhelming pretty quickly if you want to track customize analytics or want to track or create custom metrics. In this post, I will detail things I learned by experimenting with Google Analytics.

Introduction to LDAP

| Comments

LDAP is definitely not a buzz word technology these days, however a lot of organizations are still using LDAP. So, at some point in time you may be required to develop or maintain projects using LDAP. But since LDAP is an archaic technology, it is tough to discover right information about it on the web. Whenever I searched for it on the web, I found the right information filled with technical jargon and scattered across various articles. This post is my attempt at explaining everything you need to know to understand how LDAP protocol works.

Why I Love Git

| Comments

Recently I was in a discussion with couple of friends who still have to migrate on to the Git version control system. My friends had a lot of questions and showed hesitation in moving from SVN to Git. This post articulates my thoughts on why you should use Git and contains links to some excellent resources on Git that you can use to understand Git quickly.

NPM Features and Options Demystified

| Comments

In the previous post, NPM and package.json, I discussed how NPM and package.json could be used for managing the project and its dependencies. In this post I will discuss some of the overlooked features of NPM that help you in achieving more out of this tool

npm install and package versions

npm install {package} by default installs the package version tagged as “latest” in the npm registry. If you do not want the latest version of the package then you have few options. You can execute commands in the following way to control which package should be installed and from where to fetch the package.

Package with Specific Version: npm install {package}@{version}

1
npm install express@3.0.0

This command will install version 3.0.0 of express package form npm registry.

Package in a Version Range: npm install {package}@"{version range}"

1
npm install sax@">=0.1.0 <0.2.0"

This command will install sax package between version range 0.1.0 and 0.2.0

Why Memento Moved From Java to CouchApps to Node.js Technology Stack

| Comments

Memento, the app that I launched recently has already seen three technology stack changes. I started working on memento to be able to keep what I find on web with me as a personal memento. Being a Java architect I kicked off memento using Java. Since I was a solo developer on this project I wanted to keep everything lean in order to iterate quickly. This meant having an automatic code generation for the boilerplate code, using simple and powerful frameworks, following best practices, and tons of unit tests for making changes quickly and verifying the health of the app.

Spring Roo

With my lean strategy in mind I quickly used Spring Roo, a rapid application development tool for Java developers to generate the complete app with front-end, back-end, authentication, persistence, logging, and unit tests within couple of hours. So far I was happy.

Bootstraping a Node.js App for Dev/Prod Environment

| Comments

Setting up a web server in node is really simple. A basic hello world http server can be written in under 10 lines. However, if you want to write a production grade app then you are better of by using any framework that provides foundation and structure to your logic. When choosing frameworks there are no right or wrong answers. Important thing is to select a framework that is being actively developed, has community support and most of important of all you love the way it works.

Bootstrap a Node.js App with Express Application

Express is a web application framework for Node.js. It is simple to use and can be configured to work with popular technologies. To understand how Express works you can follow the Getting Started page on the express web site. This guide also explains how to use the express global executable for generating a skeleton web app.

Once you have generated a skeleton web application. You need to understand how to structure the skeleton app for the Dev/Prod parity as well as making few changes to the app for making your app modular.

Dev/Prod parity

You will notice following snippet in the skeleton app

1
2
3
app.configure('development', function(){
  app.use(express.errorHandler());
});

Introducing Memento

| Comments

Here is a wonderful application that allows you to save any web page that you like. It is your personal space with all that you like on the web. Some space that you can access whenver you like. You can create an account at www.mementodb.com

What are mementos?

Mementos are anything that you save using this application. You can think of a memento as a copy of the entire web page saved into your account for you to “use” later. When we say “use” we really mean you should be able to read, edit or print the mementos. For creating mementos we convert web pages that you want to collect into a text format that any one can edit without understanding the techonolgies of the web.

Why Use Memento?

Web is constantly changing, pages that you bookmark today may vanish tomorrow. But what if you found something on web that you want to keep as a personal memento. With Memento you can Save, Collect and Use your web.

How it Works?

Memento provides a bookmarklet that converts the web page you want to keep into Markdown and saves it to your account.

NPM and package.json

| Comments

NPM is a package manager for node. Working with NPM is really simple. It gets installed as part of the node.js installation. NPM packages can be installed locally for a project or globally for the entire system. Whenever you install packages these packages are fetched from the NPM registry.

Local Install

If you want to install any node package then you can simply do

1
npm install {package_name}

This will install NPM package {package_name} in the current working directory. This is typically root of the project.