jQuery Calendar Widget Plugin A simple jQuery Calendar Widget Plugin with a month view. You can specify which month you would like to display or have it display the current month. With just 100 lines of Javascript code, this plugin is light-weight and is perfect for its purpose. Recommended Books on jQuery jQuery Cookbook: Solutions [...]
Continue reading jQuery Calendar Widget Plugin
jQuery validation plugin – demo A simple form validation plugin (using jQuery) that checks that all required fields are filled in when a form is submitted. Recommended Books on jQuery jQuery Cookbook: Solutions & Examples for jQuery Developers jQuery in Action Technorati Tags: jquery, javascript, plugin
Continue reading jQuery validation plugin
jQuery gallery plugin – demo An accessible gallery plugin (using jQuery) that replaces the main image and image heading on the fly when a thumbnail is clicked. The Previous and Next links as well as the current image position are updated automatically. Recommended Books on jQuery jQuery Cookbook: Solutions & Examples for jQuery Developers jQuery [...]
Continue reading jQuery gallery plugin
Backuping a single table from a database mysqldump -u -p database_one table_name > /var/www/backups/table_name.sql Restoring the table into another database mysql -u -p database_two < /var/www/backups/table_name.sql For more Linux commands, please refer to: Practical Guide to Linux Commands, Editors, and Shell Programming
Continue reading Backuping and restoring a single table using mysqldump
DELETE FROM `tablename` WHERE `created` < DATE_SUB(NOW(), INTERVAL 5 DAY); DELETE FROM `tablename` WHERE `created` < DATE_SUB(NOW(), INTERVAL 1 MONTH);
Continue reading Delete rows older than x days or x months in MySQL
The following javascript snippet will get the name of a random file from a list of files specified. <script type="text/javascript"> //name of files filenames = [ "filename1.gif", "filename2.gif", "filename3.gif", "filename4.gif" ]; //get a random entry from an array of filenames var filename = filenames[Math.floor(Math.random()*filenames.length)]; //display filename here document.write("path/to/file" + filename); </script> Technorati Tags: javascript, snippet
Continue reading Display a flash/image/text file randomly using javascript
du -hs /var/www/ You may omit the directory path if you’d like to find out the size of the current directory that you are in. du -hs For more Linux/Unix commands, visit Useful Linux Commands page or refer to the following book. Practical Guide to Linux Commands, Editors, and Shell Programming
Continue reading Get directory size using Linux command
In PHP, exporting data into an excel file (.csv) can be achieved very easily by sending a raw HTTP header. And having a formula in cells is no brainier either (and I only found that out after searching through google and not finding any solution – hehe). The following is a rough example of how [...]
Continue reading Export into excel with formula in PHP
Problem: You have the following URLs for your website: www.example.com/about-us.html www.example.com/services.html www.example.com/contact-us.html However, you would like to hide file extensions from the end users, and allow them to access to the files using the following URLs: www.example.com/about-us www.example.com/services www.example.com/contact-us Solution: The solution can be achieved by using Apache’s mod_rewrite. Create an .htaccess file in your [...]
Continue reading Removing file extension via .htaccess
UPDATE `tablename` SET `fieldname` = CONCAT(UCASE(SUBSTRING(`fieldname`,1,1)),”, LCASE(SUBSTRING(`fieldname`,2,LENGTH(`fieldname`)))) WHERE `id` = 1
Continue reading Convert to sentence case in MySQL
Hello! Welcome to Web development blog! My name is Ei Sabai and on this blog, I write about web development, mobile app development, latest web technologies and the likes. Read more 

