Archive October 2010

Get YouTube video thumbnails (the easy way)

Posted by Danny Herran on Oct 20, 2010 in Other Stuff | 1 comment

YouTube has an API to do this, however, there is an easier way to pull the thumbnails of a specific video if you know its ID. You can use this trick in any of your applications and it is not language specific.

A little dot that made me pull my hair off

Posted by Danny Herran on Oct 15, 2010 in Frontend, Other Stuff | No comments

I was coding a long signup form, a very nice one, with the jQuery Validation Plugin, but it wasn’t working. I started to strip the code, piece by piece so I can identify what was causing the plugin to ignore the form and I came up with the most stupid error you will ever seen in your life (at least I think so).

Yes, a little dot that I don’t even know how to write with my keyboard. I even tried to replicate it and I couldn’t. 2 hours of coding wasted on this little bastard. Can you believe that?…

Trim long texts by words in PHP

Posted by Danny Herran on Oct 14, 2010 in Backend | No comments

We don’t like reading chopped sentences like “Star Wars Old Republic is be….”. It looks fugly. Usually, when trimming text you will go with substr(), but there is a much better way to do it, and believe me, you trimmed text will look so much better than before.