I am Hack Sparrow
Captain of the Internets.

How to merge a specific commit in git

You were working on a certain branch of a git repository, and you committed some changes to it. Then you realize, this particular commit should also go to another branch of the repository BUT you are not ready for a complete merge. Maybe this commit was meant for the other branch? You want to merge this particular commit from the current branch to the other branch of your requirement. Merging a specific commit from one branch to ...

OS X El Capitan screwed up Ruby gems, and how to fix it

After I updated my MacBook Pro's OS to El Capitan, all the command line tools installed via Ruby gems were gone - command not found. Here is what I experienced and how I fixed it. On trying to reinstall the gems using gem install, I was met with a permission error. Usually this kinda issues are fixed with the use of sudo (even if not recommended), but not this time - even sudo was faced with a permission error. I got to learn that this wa ...

Mongoose Pagination Plugin – Mongoose Pages

I have been wanting to write a Mongoose pagination plugin for a long time. Not that there were no pagination plugins for Mongoose, it is just that the available plugins had a rather developer-unfriendly API. Officially presenting Mongoose Pages - the developer-friendly pagination plugin for Mongoose. Installing Mongoose Pages is simple. Just type the following command at the terminal. [code] $ npm install mongoose-pages [/code] If your ...

Understanding directory references in Node.js

So, there are three different ways to refer to directories in Node.js; namely - dot notation (./ and ../), __dirname, and process.cwd(). While all of them might seem to refer to the same thing, they can become a source of confusion and bugs, if they are not understood well. Let's examine how they work. Create a directory named base with the following tree under it: [code] . ├── app.js └── /one ├── on ...

My book on Express.js is published

I have been blogging about Express.js for quite some time now. Early this year, I was contacted by Packt, enquiring me if I'd be interested in writing a book on Express. A year ago, I had this idea to write a book on Express, which would be titled "Mastering Express.js", and worked out an early-stage table of contents for it. So when Packt contacted me, I told them that I would, in fact, be very interested in writing a book on Express. Sin ...