Parse HTML using jQuery-like syntax in PHP

Quite often there is a need to parse HTML and extract some values from deep-deep nested tables or so. Most front solution is to use regular expressions but they sucks with nested tags. Other way is to use XPath, which performs much better here, but has not simple syntax to use.

Nowadays almost all PHP developers knows jQuery, which became like a standard in front-end development. Why not to use it for HTML parsing using familiar syntax.

Scale images to FIT/FILL bounding box in PHP using GD

Quite often I was in need a function to scale an image to the size right to fit into bounding box.

For example, displaying images of real estate or product image in the shop site. Images can be different sizes, less or bigger of target size, portrait or landscape, etc..

I wrote little helper function in PHP that does that tasks using two modes: FIT and FILL. It uses standard PHP-GD extension.

How to run PHP cron tasks without cron available

In most cases hosting panels has CRON jobs available, so using cron is not an issue. Just sometimes you do not want to bother with it because of many reasons like no cpanel password, makes your script installation process complicated, or even cron is simply not available at all.

In this case I found interesting technique how to overcome this.

How to merge/mix/combine RSS feeds

One problem I faced on my multi-language blog setup - it has different feeds for each language. Multi-language plugin WPML which I use does not have feature to mix feeds into one. I like my subscribers to see one common feed which is merged for all languages and leave possibility to subscribe to one language also. I setup simple solution using pure PHP.

Introduction to HTML5 History API

HTML5 slowly releases all its beauty. Before HTML5 one thing which was almost completly out of our control was  the browser history manipulation without full page reload (location.hash hacks are not counted here). With appearence of HTML5 History API all things changed, now it is possible to add elements to the history, add navigation handlers and more.  This time I am going to dive into HTML5 History API.

Deploying a web application via FTP

When your brand new application looks shinny, it is time to put it on the Internet, process called deployment. Usually this involves several steps, like uploading application files, creating remote database, setting up configuration, etc.. Once it is setup and running you reazlise that your app is missing features X, Y and Z and deployment starts over and over again, this often leads to strange bugs.

I use simple lftp command line tool to automate project deployment via FTP and eliminate any possible deployment errors.

File uploads in HTML5 - what's new ?

html5 file upload

File uploads have traditionally had very bad usability on the web. The standard solution was uploading files as part of a form, leaving the user to just wait until the process was done. We could offer barely any feedback of what was going on. Several options appeared in HTML5 to make the process more bearable for the user.

PHP Development in the Cloud

Nevertheless Amazon recent downtime showed us that clouds are not panacea for all problems, they are the future. Especially when quick scale, precise resource allocation is needed.

This book is about  applying your PHP skills in a clouds.

Most developers gloss over when they hear “the cloud” as the term has been appropriated by marketing types and has very little true meaning anymore. In this book, Vito and Ivo strip bare the buzzwords and help PHP developers figure out what the cloud is actually about and how they can take advantage of what cloud computing has to offer. After reading this book, you will not only have a clear picture of what cloud computing is, but you’ll also be able to utilize the various cloud services that are out there.

OpenID login for Yahoo and Google accounts

I've updated my Openid sample code for logging in  with Yahoo and normal Google accounts.

Google Apps as single authentication point for your corporate applications

This is an update to my post "Google Apps Premier federated login with PHP". Idea is simple, users do not like passwords, less passwords - less pain and more security.

Nowadays many companies have gone cloud, which covers most needs, but leaves space for homegrown small applications, ideas, prototypes, etc. It is convenient to organize user login into these applications using already existing Google Apps login infrastructure.

This is about using it with PHP.