Command Line Polling
In an ideal world, we wouldn't have to poll for anything; we would always have events to trigger other functions. This isn't an ideal world, however, so it's important to know how to poll in multiple programming languages. I've covered JavaScript polling (with and without Promises), but what about command line polling? For example, ensuring MYSQL is up before attempting to perform more operations.
Here's the basic syntax:
# while ! (command here); do
while ! mysql -uroot; do
sleep 1
done
The example above performs the mysql -uroot
operation (which will fail until mysqld
is up) every second. Keep in mind the poll operation you run should be as simple as possible, just enough to know that what you want to use is available!
With CSS border-radius, I showed you how CSS can bridge the gap between design and development by adding rounded corners to elements. CSS gradients are another step in that direction. Now that CSS gradients are supported in Internet Explorer 8+, Firefox, Safari, and Chrome...
Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...
Mozilla's Christian Heilmann is an evangelist that knows how to walk the walk as well as talk the talk. You'll often see him creating sweet demos on his blog or the awesome Mozilla Hacks blog. One of my favorite pieces...
Since we've already figured out how to create TinyURL URLs remotely using PHP, we may as well create a small AJAX-enabled tiny URL creator. Using MooTools to do so is almost too easy.
The XHTML (Form)
We need an input box where the user will enter...