Recently Added

Progressive enhancement with the Google Font API

Posted by oshua in General on 22. Jun, 2010 | No Comments

I like the Google Font API. It is a clean and easy way to introduce a progressive enhancement on websites. The lack of an easy way to introduce sophisticated fonts has been present with the web since its origins. One of the most sucessfull solutions to face this in the past has been the CSS [...]

Why not Flash? How to suggest your clients to stay away from Flash abuse

Posted by oshua in General, HTML on 09. Jun, 2010 | No Comments

It is the year 2010. Steve Jobs has openly stated Adobe Flash Player will not be supported on iphones. HTML5 is on its way with native video, audio and canvas support. Javascript libraries are making huge improvements in allowing, easily, the creation of dynamic websites without Flash, but guess what, many clients are still asking [...]

Getting root element of an XML with PHP SimpleXML

Posted by oshua in PHP, XML on 06. May, 2010 | No Comments

It is quite easy to get the root element/node of an XML string or file but just doesn’t seem to be explained elsewhere

Converting an XML to an array with PHP: a basic benchmark

Posted by oshua in PHP, XML on 06. May, 2010 | No Comments

SimpleXML seems like the way to go according to a simple benchmark

Better radio buttons with JQuery

Posted by oshua in HTML, JQuery on 04. Dec, 2009 | 2 Comments

Radio buttons are pretty dull, they look as if they were coming from the beginning of the Internet. With JQuery they can look prettier and be easier to use, without disturbing those browsers that do not have javascript enabled and specially without having to change anything on the server side.

PHPExcel: read Excel from LAMP

Posted by oshua in PHP on 22. Oct, 2009 | 1 Comment

PHPExcel (http://www.phpexcel.net) is a set of classes to read and write Excel effectively, but it is even much more than just that.

Sending form vars as a serialized PHP object with JQuery

Posted by oshua in HTML, JQuery, PHP on 30. Sep, 2009 | 1 Comment

Sometimes you want to pass only part of a form through ajax to get some results without updating the whole page. JQuery has some great functions to convert the content of a form into a serialized string or object (either serialize or serializeArray). However they both take the content of a full form as input [...]

Select boxes with html inside each option

Posted by oshua in HTML, JQuery on 23. Sep, 2009 | 3 Comments

I needed to add HTML inside the options of a normal html select box, preserving the behaviour of this custom select box as close as possible to the normal one. I needed also that this custom select box could degrade into a normal select box if required to. View demo

Inserting anonymous content on a database

Posted by oshua in Mysql, PHP on 16. Sep, 2009 | No Comments

When working in a web application that needs to do a complex insert on several tables of a database sometimes you need to know the next autoincrement id from one table although this record does not exist yet. For example, let’s say you wish to allow¬†users to join to your service but while doing it [...]

Making php-ffmpeg work on latest ffmpeg version

Posted by oshua in Linux, PHP on 09. Sep, 2009 | No Comments

Every now and then upgrades on ffmpeg affects php-ffmpeg. This is happening now with php-ffmpeg 0.6.0 and latest version of ffmpeg.
To compile php-ffmpeg 0.6.0 with latest ffmpeg version successfully you will need to follow these 2 steps:
1. First issue is reported in many places on the web. On the file ffmpeg_frame.c every ocurrence of PIX_FMT_RGBA32 [...]

PHVsPjxsaT48c3Ryb25nPndvb19hbHRfc3R5bGVzaGVldDwvc3Ryb25nPiAtIGRlZmF1bHQuY3NzPC9saT48bGk+PHN0cm9uZz53b29fYXV0b19pbWc8L3N0cm9uZz4gLSBmYWxzZTwvbGk+PGxpPjxzdHJvbmc+d29vX2N1c3RvbV9jc3M8L3N0cm9uZz4gLSA8L2xpPjxsaT48c3Ryb25nPndvb19jdXN0b21fZmF2aWNvbjwvc3Ryb25nPiAtIDwvbGk+PGxpPjxzdHJvbmc+d29vX2V4Y2x1ZGVfY2F0czwvc3Ryb25nPiAtIDwvbGk+PGxpPjxzdHJvbmc+d29vX2V4Y2x1ZGVfcGFnZXM8L3N0cm9uZz4gLSA8L2xpPjxsaT48c3Ryb25nPndvb19mZWF0dXJlZF9wb3N0czwvc3Ryb25nPiAtIDU8L2xpPjxsaT48c3Ryb25nPndvb19mZWVkYnVybmVyX3VybDwvc3Ryb25nPiAtIDwvbGk+PGxpPjxzdHJvbmc+d29vX2dvb2dsZV9hbmFseXRpY3M8L3N0cm9uZz4gLSA8c2NyaXB0IHR5cGU9XCJ0ZXh0L2phdmFzY3JpcHRcIj4NCnZhciBnYUpzSG9zdCA9ICgoXCJodHRwczpcIiA9PSBkb2N1bWVudC5sb2NhdGlvbi5wcm90b2NvbCkgPyBcImh0dHBzOi8vc3NsLlwiIDogXCJodHRwOi8vd3d3LlwiKTsNCmRvY3VtZW50Lndya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