With the advent of modern browsers, web pages are using more and more javascript and stylesheets to make applications work faster and look better. And this is achieved with caching the Javascript, images and CSS files in the browser cache in user’s machine. This is great for speeding up page load for end user, but...
Category: Quick Fixes
Working with Access-Control-Allow-Origin
When developing Ajax applications on local machine you may face this error on almost all browsers that cross referring a link from other domain is not allowed. This is mentioned as the “Access-Control-Allow-Origin” on Google Chrome. To work around this issue, temporarily – yes temporarily as this may make your system unsafe – you need...
Displaying UTF characters in the FPDF
It is very easy to show UTF characters in a FPDF generated PDF file. Just use the following conversion function and it will work. Assume you have initialized the FPDF class to $pdf variable and you want to print the string stored in $name variable: $pdf->Write(iconv(“UTF-8”, “ISO-8859-1”, $name)); It worked for me.
Exporting WordPress blog to Blogger
If you ever need to export your wordpress blog to Google Blogger, then you can use a great tool for this I just found – Convert WordPress Export to Blogger. Follow below steps: Export your wordpress blog as XML file. Use the tool above to convert that XML file to blogger compatible import file. Use...
Apache Keep Alive Directive
Today, I was analysing a website for performance improvements using the Page Speed tool by Google. One interesting thing I found out that it was recommending to enable the KeepAlive feature of Apache web server. Usually this is enabled by default, but somehow on the VPS I was working on, it was disabled. So if...
Javascript code to convert date to timestamp
This is not everyday that you need a Javascript function to convert the date and time string to UNIX timestamp. But if you do need this like me, then here it is: function covertToUnixTime(yourDate) { //Subtract 1 from month to accomodate the month start from 0 in the function return new Date(yourDate.substring(6, 10), ((yourDate.substring(0, 2)...
Session issue in IIS with CakePHP
When working on PHP and MySql development we rarely get a chance to install the application on Windows IIS server. And today I was asked to do the same. The first issue was related with mod_rewrite which is easily solved by un-commenting the line – Configure::write(‘App.baseUrl’, env(‘SCRIPT_NAME’)); But the big issue came when I found...
Merge the remote changes before pushing again : Git Message
When you try to push to a GIT Repository and you get this message that mean’s that someone else has changed the repo after your last fetch. In this case you have to incorporate their changes before you can add yours, it is easier to ‘rebase’ rather than merge, just follow the below steps. $...
Using AjaxHelper for pagination in CakePHP 1.3
I am using CakePHP since last 5 years, and am quite used to of “AjaxHelper” for developing Ajax features using CakePHP. But from version 1.3 CakePHP has started deprecating the “AjaxHelper” replacing it with new “JsHelper”, which can be used with many JS libraries. While AjaxHelper is still there for people like me. There is...
MySql Dump Using a PHP Script
When you need to take a backup of a large MySql database, then “mysqldump” command come most handy and does the task in few seconds. But for that we need to access the web server or database through SSH. And database access in 99% cases is not allowed from remote location for security reasons. I...