UltraMega Blog
30Jun/090

FireFox 3.5 – What does it mean for Web developers?

FireFox 3.5 has been released! Along with a long list of new features and faster browsing, FireFox 3.5 also implements the latest Web technologies such as HTML5 and CSS3. Here is an overview of some of the more interesting features...

New in FireFox 3.5

  • HTML 5 features:

    • audio and video - These elements provide native support for embedded audio and video, which means supporting browsers won't require any 3rd party plugins.
    • Drag and drop - API that allows dragging items within or even between websites.
  • CSS3 features:
    • @font-face - Allows you to use fonts without requiring the user to have them installed. Fonts are downloaded from the server as needed!
    • Media queries - Allow you to specify different CSS rules based on different media types, or even a wide range of specific features (such as screen size).
    • text-shadow - Applies shadow effects to text.
    • -moz-box-shadow - Applies shadow effects from almost any element!
      • -moz-border-image - Specifies an image to use for an element's border.
    • JavaScript features:

    See the full list of developer features available with FireFor 3.5.

    25Jun/0934

    Create a Slide-In Panel with jQuery

    In this tutorial, I'll explain how to create a slide-in panel effect with jQuery. Basically, this means a hidden panel the slides into view when it is triggered by a button or other action. This is often used to display a contact form in a fun way, which is exactly what I am using it for on the new UltraMega website. As it turns out, this is very easy to do.

    View Demo

    23Jun/090

    What’s new in PHP 5.3?

    With last week's announcement of RC4, the final release of PHP 5.3 is imminent. So what can we expect in this version? Here I'll outline the biggest and most interesting changes and additions. This is definitely not exhaustive since there are tons of minor changes and improvements in this version, but these are some of the ones I found interesting.

    Tagged as: , Continue reading
    16Jun/094

    5 Tips for Writing Cleaner PHP Code

    There are many benefits to writing clean code for any project, no matter how small. The most obvious benefit is that it is easier for you to read and edit, especially when you come back after a long break. This is even more important when someone else comes in to modify your code. The importance of clean code becomes most apparent when you need to find an error, especially a syntax error. In the end, cleaner code means less time reading and more time coding!

    These are 5 tips that I use and recommend. I know there are plenty of lists like this, but I hope you learn at least one new trick...

    3Jun/099

    Snippet: Converting Seconds to Readable Time (PHP & JS)

    Sometimes, you might need to convert an integer representing seconds into a format that is easier to read. These functions can be used to turn a number of seconds into a simple format of HH:MM:SS, with leading zeros (ex. 15272 = 04:14:32). This can be used for countdown scripts, which is why I also include both a PHP and a JavaScript version.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    function formatTime($secs) {
       $times = array(3600, 60, 1);
       $time = '';
       $tmp = '';
       for($i = 0; $i < 3; $i++) {
          $tmp = floor($secs / $times[$i]);
          if($tmp < 1) {
             $tmp = '00';
          }
          elseif($tmp < 10) {
             $tmp = '0' . $tmp;
          }
          $time .= $tmp;
          if($i < 2) {
             $time .= ':';
          }
          $secs = $secs % $times[$i];
       }
       return $time;
    }