Get your bash scripts to sleep (halt execution) on Shippable and Travis

As I write this, it’s been about 36 hours without sleep for me — enough to relate to the importance of sleeping. However, this discussion is around getting a bash script or JavaScript on NodeJS to sleep for a specific duration.

#!/usr/bin/env bash

echo "Feeling drowsy...";
sleep 10;
echo "Woof! Back up after 10 seconds!";

The sleep command in unix allows one to pause execution of a script for a specified duration. It is a very handy tool in times where a script needs to wait for some other asynchronous work to complete. (Kindergarten talks for many!)

Continue reading “Get your bash scripts to sleep (halt execution) on Shippable and Travis”

JavaScript Drag Events on iPhone and Other Touch Based Devices

For quite a while this week, we were trying to work on dragging JavaScript elements on iPad and other devices with touch input. For our case, we already had jQuery included in our codes, hence we were tempted to use the touchmove event and depend on native jQuery to do the rest.

Things turned out to be a bit trickier. After implementation, it struck us that with jQuery bound events, event.pageX and other related mouse coordinate attributes would not work. Add to that, we were using the jQuery.event.drag plugin by ThreeDubsmedia to seal of the dirty job of drag-related coding.

Armed with the above two problems, we started to do what we thought would be the fastest solution – modify the jQuery.event.drag plugin for a graceful upscale!

Continue reading “JavaScript Drag Events on iPhone and Other Touch Based Devices”

Batch Image Processor 1.0.0b Released

During my regular use of computers, I realized that there isn’t a good software that does simple repetitive actions on images. What I wanted to do is simple resizing of a set of images before I could upload them to Orkut or Facebook. I always ended up opening a huge image processing software to do the job. Even while using dedicated image management software like Picasa, I realized that for simple resizing of images I needed to perform a large number of steps.

Continue reading “Batch Image Processor 1.0.0b Released”