All posts by Morshed Alam
Mysql backup on linux using ssh and cron
Sometimes, we may need to backup and synchronize mysql on linux as a background process. Linux has a great program for this called cron. It allows tasks to be automatically run in the background at regular intervals. Create a script file(.sh) using following code snippet to backup and restore database in to another database: ssh…
Find mouse pointer position using JavaScript
Sometimes we need to know the mouse cursor position to perform a certain action at that place. For example, I need to show up a popup div near the mouse cursor position when user click over a particular field/link. You can get the mouse cursor position using following codes: function getCursorPosition(e) { e = e…
How to do custom redirection of a website
Usually the redirection needs when a website changed/move to different location though it may use for lots of other purposes. In this post, I have explain how you can do it by using .htaccess Say, your site has lots of URL and you want to redirect some of those which query string has a parameter…
Change file extension in URL
In my previous article I have shown how you can use different extension of a file instead of .php explicitly but in this post I have explain how to rewrite the URL instead of renaming the file extension explicitly. To rewrite the URL you must add following lines in a .htaccess file and place it…
Hide the fact that the web pages are written in PHP
Sometimes you may want to hide the fact of your web site’s written language to visitors then you can do it easily by using .htaccess Say, you have developed your site by using PHP and wanted to show it as ASP then you can do it by using following tricks: Just add following line in…
HTML coding guidelines
This is my third article about coding guidelines. In this article I wanted to give you some general guidelines for HTML coding that will help to improve readability, maintainability and code reuse. It will reduce browser related problem. Following are some guidelines: Must be use doctype in your web page. Everyone should be write well-formed…
Specify rendering engine of IE
Internet Explorer 8 supports different document compatibility to ensure that your web pages have a consistent appearance in future versions. If you are having trouble on a site in different IE, you can use specific rendering mode to display your web pages by using simple META tag. Below is the META tag to use IE7…
The bundled mysql.rb driver has been removed from Rails 2.2
After two months, I have started working on rails again and upgraded Rails to 2.3.2 on my laptop. After upgraded when I have tried to run a sample rails application and got following errors: => Booting WEBrick=> Rails 2.3.2 application starting on http://0.0.0.0:3000!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install…
JavaScript coding standards/conventions
The long-term value of software is depended of the quality of codebase and it helps to reducing the weakness of programs. That’s why we should follow standards while writing Js code which will increase the code quality. I am trying here to give you some idea/suggestion to write better Js code. Below are some suggestions…
CSS coding guidelines/conventions
While writing CSS code, everyone should be follow a standard or convention. It is not important to remember a convention what should be follow. Important is to follow any style constantly, actually it is a common sense though it is not common sense to everybody. I am just writing it to provide others with one…