Archive for category General

Find out PHP execution time

function microtime_float ()
{
list ($msec, $sec) = explode(’ ‘, microtime());
$microtime = (float)$msec + (float)$sec;
return $microtime;
}
$startdebug = microtime_float();

$end = microtime_float();

echo ‘Script Execution Time: ‘ . round($end – $startdebug, 3) . ‘ seconds’;

, , , ,

No Comments

Reading Text Global Resources Hang with photoshop

HOW TO SOLVE THIS PROBLEM.

1. Find the file called “Adobe Photoshop CS Prefs.psp” in the following folder:

C:\Documents and Settings\user\Application Data\Adobe\Photoshop\8.0\Adobe Photoshop CS Settings\

* note: user will be whatever your are loged in as.

3. Delete this file or rename it to: Adobe Photoshop CS Prefs-old.psp (i just put “-old” at the end) – or whatver you want. The goal is so that photoshop doesnt use this .psp file again when it starts to load.

4. start photoshop again.

, , , , , , , , , , ,

No Comments

Programming tips

  • Name your functions and variables with meaningful names so that people will understand the function or variable just by reading it’s name. If a function return best selling product, name it like get_best_selling_products().
  • Do a lot of comment for your code, especially if you are working in a team. By commenting you are making other peoples life more easy.
  • Make your function small where you can see all code for that function in one screen without scrolling. When the function is getting bigger than your screen, its time to split it into smaller function.
  • If your chunk of code is often use, then create a function for it so every part of your application can call this function. An example of this is database connection and query.
  • Put your javascript code and css style in different file. Save your javascript as .js file and your css file as .css file.

, , , , , , , , , ,

No Comments

Instaling wordpress MU on subdomain

A nice tutorial on setting wordpress MU on subdomain. http://www.blogopreneur.com/2006/11/06/installing-wordpress-mu-on-a-cpanelwhm-server/

No Comments

Testing IE with firefox plugin

Here’s a great plugin for testing IE. This is a great tool for web developers, since you can easily see how your web page displayed in IE with just one click and then switch back to Firefox.

,

No Comments