Clear Firefox cache – the fastest way

Firefox clear cache

Firefox creators made things really user friendly IMO You can clear Firefox cache by following these three steps: Press Ctrl+Shift+Del Choose the time range and tick the part of your history you wanna get rid of (Browsing and Download History, Forms & Search Data, etc…), you may need to click the arrow to show those [...]

JavaScript Tween function

This is a small library I wrote for creating simple and complicated easing effects without using JQuery, MooTools or other JS libraries. The library is small 13.4 KB or 5.6 KB compressed, The function can be called as follows: tween(element, property, from, to, duration, [optional] function) Parameters element: The id  of the HTML element you [...]

How can I set a WordPress page as my blog homepage

WP homepage options

This can be done with a few clicks from your WordPress blog control panel. So first login to your control panel, then under the Settings menu choose Reading, after the page finishes loading, choose A static page (select below) for the option Front page displays, then on the first drop-down list  that follows choose the [...]

JavaScript round float to n decimal points

The best you can do with built in JavaScript functions is to round a number to the nearest integer using the method Math.round(x), so to round a float to n decimal points we need to come up with our own function. The function round_float() rounds a floating point number x to n decimals, if you [...]

My category order not working after WordPress upgrade

Description You just upgraded WordPress and “My Category Order” (widget and functions) do not display any categories. I hate to be you! But wait… Solution This is normal and you can fix it very easily by visiting the “My Category Order” page. When you visit the plugin page the first time after a WordPress upgrade, [...]

setAttribute/getAttribute(“style”) crossbrowser alternative

The JavaScript methods setAttribute and getAttribute are very handy when you are designing dynamic effects for your website, but those methods have a lot of bugs in IE (6 an 7 at least), I use these two crossbrowser functions as alternatives instead of using directly setAttribute() and getAttribute(), I’ve been using them for quite a [...]

How to upgrade Ubuntu from 8.10 to 9.04 using the command line and the Internet?

You can upgrade your linux system using the package manager APT which is available on debian based distributions: First we have to update all the packages installed: $ sudo apt-get update $ sudo apt-get upgrade Now we make sure that we have the update-manager-core package installed with: sudo apt-get install update-manager-core Then we start the [...]

How to check a file type efficiently in PHP?

The Problem Do you know a method in PHP to check the type of an uploaded file without relying on extension or Mime-type because these two can be faked? Verifying the file type in PHP Relying on the Mime-type of a file submitted by a user is a bad practice, using the extension is even [...]

Print HTML code from JavaScript variable

This also was about to drive me crazy so I will not let it go without writing about it.. Let’s say you have some long HTML code contained on a PHP variable, something like this <?php $some_div = ‘ <div id=”box”> <h1>Title</h1> <p>Article contents + comments</p> <div>’; ?> Now you want to use this HTML [...]

A note on JavaScript arrays creation & initialization

I use PHP a lot in my projects and it happens that sometimes I combine PHP with another language and write completely useless code. PHP arrays can be created and initialized with like this: <?php $cities[] = “mecca”; $cities[] = “medina”; ?> I thought that the same would apply to javascript… Yes, it can work, [...]