Monthly Archives: December 2011

Archive

Auto linking text string having image tags using Text Helper in CakePHP

Recently I found that auto linking urls and emails of a string having image tags within was not possible using text helper in CakePHP. It would try to autoLink url of image src and thus it is broken. I am not sure what the issue is in including a fix or solution which could avoid image tags while auto-linking. Then, perhaps you would have to consider other tags like object src and video urls etc. In fact it would be too tedious to handle all kind of html tags and so and so.. Continue reading

A php tool for adjusting or correcting time of subtitles of a video movie

As English is not my mother tongue i do like (at least first time) subtitles running while watching an English movie. This time while i was watching another movie the only subtitles’ file i found over there had a straight delay of 16 seconds at the beginning. In fact , the VLC player which i normally use to play movies does have an ‘advanced option’ to handle delay of subtitles but in my somewhat special case it too failed to handle it properly. In fact i wouldn’t been bothered what i had eventually to do if i could find a most matching subtitles file but i wasn’t lucky enough. Here’s the case that made me to write this small tool: Continue reading

Getting current page url and title for social network sharing in WordPress

Today i added a few social network sharing buttons i.e. facebook, twitter, delicious, myspace etc. to the right side column of this very blog.  To make it work as desired I had to do some extra bit of effort to create respective urls and titles for sharing. Continue reading

Field type tinyint(1) would not save values other than 0 and 1 in CakePHP

Just a quick note. I had a “is_active” field in my users table which i had been using to store boolean 0 and 1 values. Later, i mean today, i decided to save a new value -1 to this field but when i did try, it would’t save -1 and would always save it as 1. After looking at a few blog posts around the web i found that in CakePHP every time you try to save a value other that 0 or 1 into a tinyint(1) field it would save it as 1 (as according to Nate, Continue reading

Making line-through color to appear different than the text (using CSS)

I am posting a simple trick to make the color of line-through line to appear different than the stricken text. I had to recall this trick actually as we rarely use it and i guess i myself never used it before i guess (may be i had but i don’t know exactly. :) ). Continue reading

A few notes on joining a MySQL table to itself to get unique combination of field data

Just a few notes on joining a MySQL table to itself to get unique combination of data stored in its fields.

Suppose we have a MySQL table named `keywords` having fields `word1`, `word2` and `word3`. Once we have got a few records inserted into this table we would want to show all possible combination of keywords stored in those fields. For example, a select query returns a following set of data: Continue reading

Fixing ‘mysql’ is not recognized as an internal or external command in Windows7

Having WAMP installed when i try to type mysql in my windows command prompt it would give me the following error: Continue reading

How to add HTML tag keyboard and toolbar shortcuts to Notepad++

(skip to implementation) Like most computer users i do prefer to use keyboard shortcuts and while working with web pages in particular, keyboard shortcuts and visual shortcuts in editor toolbars speed up development work considerably. There are HTML editors like Adobe Dreamweaver which do almost everything automatically for you, but you need to purchase a license to permanently use them and also they seem to consume large amount of computer RAM. Continue reading