Listing files using glob patterns in nodejs

In a previous post we saw how to monitor files changes in nodejs. This was required in a cron job to check which files were changed by the cron process. I also needed to search for files in a particular directory to check which files were newly created by the process. Although this is possible using the file-state-monitor package, I needed the ability to use glob patterns while searching.
(more…)

Read More

Five APIs All Developers Need to Know

Every day, dozens of developer tools get released online. Some new developers opt for doing all their work manually, while others choose to explore new tools. If you fall into the second category, then you need to start using APIs. The acronym stands for
Application Programming Interface. In essence, it’s a programing language that lets one service – let’s say Google Maps for instance – communicate with another – for example, AccuWeather.
(more…)

Read More

Unpacking binary data in PHP

Working with binary files in PHP is rarely a requirement. However when needed the PHP ‘pack’ and ‘unpack’ functions can help you tremendously. To set the stage we will start with a programming problem, this will keep the discussion anchored to a relevant context. The problem is this : We want to write a function that takes a image file as an argument and tells us whether the file is a GIF image; irrelevant with whatever the extension the file may have. We are not to use any GD library functions.
(more…)

Read More