Microsoft Language translation is an interesting service. Not only can you do language translation, you can also detect the language of a particular text. The given class provides a PHP wrapper which will help developers translate text from one language to another in a easy manner. The library also supports caching, helping you keep your [...]
One of the important reasons for the popularity of WordPress is its plugin architecture, which has enabled thousands of programmers to write additional functionality for WordPress. But the plugins are constrained in silos, unable to be controlled by outside programs ( well this can be advantageous if you consider security). Take the popular WP-Super-Cache plugin. [...]
The following is a very short code to read the version number of a PDF document using PHP. I needed this recently during a PDF processing app developed in PHP. As Adobe uses different compression methods in various versions, it becomes necessary to be able to identify the version of the PDF under work.
Frequently one needs to get the last few lines of some log files, whether php error logs or Apache logs. Most of these file sizes run into megabytes, which makes it difficult and time consuming to remotely open them using ftp. If you have shell access then you can easily use the *nix ‘tail’ command [...]
Below is a quick hack to retrieve and save Gravatars. Gravatar images come in various formats, but we don’t detect them here, just save the retreived image in ‘jpg’ format.
In the previous post we saw how we can generate a screenshot from a url. In this post we will see how we can create a color palette of the screenshot (or any other image for that matter) using PHP and GD. This can be useful if you need to quickly get the color scheme [...]
Taking screenshos of websites is not a frequent requirement for developers but can come handy on many occasions. Although there are some nice solutions on the web, a particular one I found very good is wkhtmltoimage. wkhtmltoimage is a simple shell utility which can be used to convert html to images using the webkit rendering [...]
With a proliferation of mobile devices, web applications now need to be able to detect if it is being viewed on a mobile platform. The mobile detection library here can help you in these matters. Obviously I’ve not tested it on all available devices but it worked on a few I’ve got.Sample code and a [...]