Monday, June 6, 2011

Profile link system site.com/username Apache

This one is fairly simple but took me a while to figure out due to lack of examples/how to on the web for this thing:

  1. Make sure your server has mod_rewrite on! That one is easy to figure find a how to online if you are not sure.
  2. Then, make sure you have a .htaccess file you can modify or create
  3. Link a unique field to a user id in the Database so he can chose his site: EG: On google for example, it would look like www.google.com/neobahamut20
  4. In your .htaccess file, add the following:
    # PROFILER
    RewriteEngine On

    RewriteRule ^([\w_-]+)$ profile.php?u=$1
    # END PROFILER


  5.  And it should work. Make sure however that you do not allow dots when the user chooses his name with this one as it will not be found instead of redirecting to a profile page.
  6. Don't ask why this need a  ^ at the beginning when normally the regex wouldn't require one. (if you know, please comment!)

Tuesday, May 31, 2011

Jquery Tools

Since Jquery, Web designing has been much easier, that part, everyone knows. However, for a real user experience, that wasn't fixed, until the team at flowplayer.org released Jquery Tools, a library based on the JQuery framwork offering various tools for the developers. Here are the tools:
  • Tabs (Feels familiar, just like Windows' tabs)
  • Tool tips (Best way to show optional info)
  • Overlay (Includes expose & mask)
  • Scrollable (Gallery surfing)
  • Form (Date input with calendar amongst others)


No amount of words can describe what those tools do. It is best to see for yourself. The demo page can be found here.

Monday, June 28, 2010

How to time code execution in PHP


$time_start = microtime(true);   
$time_end = microtime(true);
$time = $time_end - $time_start;




//code to time here


echo "go asset options & percentages in $time seconds\n";