My last few blog post’s are result of the project that I am currently working on, and this blog is also in that series. We needed to catch PHP Fatal Errors in the production environment and notify about it to developers, also at the same time, showing our beautiful fail whale page to user instead […]
Category Archives: how too?
PHP5 patch for FunctionList plugin of Notepad + +
As you may know Notepad++ is my preferred development tool for PHP, and two months back I found FunctionList plugin that shows list of function in a opened PHP file, and it increased my productivity almost immediately. Only drawback was that it showed just function list and not variables. And today I found this neat […]
Installing PEAR and PHPUnit on WAMP and Windows 7
In the project that i am currently working on, we decided to use PHPUnit for doing our unit testing, and i found that it was not a straight forward thing to install that I had thought it would be. I had to start by installing Pear, and as soon as i type ‘go-pear’ in command […]
Simple Way To Add Global Exception Handling In CodeIgniter
I am working on a project where we needed to capture exceptions at a global level instead of doing it at every step as they were not critical, but important for us to know. The idea was that whenever such an exception occur on production we should send an email to developers mailing list so […]
How to get Latitude/Longitude from an address (or Geocoding ) using PHP
While Google’s documents for maps API does good job in showing how to get lat/long from an address in JavaScript they do not really show any example of doing the same with PHP. So to make you life simple here is a small script in PHP that does that. $geocode=file_get_contents(‘http://maps.google.com/maps/api/geocode/json?address=573/1,+Jangli+Maharaj+Road,+Deccan+Gymkhana,+Pune,+Maharashtra,+India&sensor=false’); $output= json_decode($geocode); […]
How To Fix MySQL Error – Error Code 30
Yesterday was one of those days when things that can go wrong went wrong and today was MySQL day, and problem when accessing any table on a live site resulted in following error MySQL Error – Can’t create/write to file ‘/tmp/#sql_7d3f_0.MYI’ (Errcode: 30) It took me some time to figure out that the error was […]
Where is MySQL Gone Away?
Last Sunday I got to work on a very interesting problem in WordPress which I initially thought could be solved in like 5 mins, but alas it took me almost 7 hours before I found and fixed the problem. Let me describe the problem, I was running a simple xml parsing script whose task was […]
Media Manager Browse Button Disabled In Joomla
Problem : No matter how many time you click on the media manager’s browse button nothing happens. It used to work few days back but not any more. It is as if the the media manager buttons has been disabled. If you were facing these problems it is most probably due to the Flash uploader […]
How to use SVN and Git together to get the best of both worlds in Windows
I have been using SVN to manage my source code for last three years, I can say I am quite happy with it, except for one problem, it was not possible to commit the code unless I was directly connected to my office network. Then I heard about DVCS and Git. I found solution to […]
Simple JavaScript ‘Frame Busting’ Code
Here is a quick JavaScript code that you can use if you want to make sure that no one should be able to show your website in an IFrame. <script type=”text/javascript”> if (top !=self) { top.location=self.location; } </script> Just put this code in head section of your html page, and it will ensure that your […]