Category: Development

  • Determine if an element is visible with Jquery

    When I interview web developers, I always like to ask the following basic Javascript question:

    Write a function in Javascript that will ‘toggle’ or show/hide an element upon being fired.
    [code]
    function toggle(elementIdValue) {

    }
    [/code]

    I typically see one of two answers: Jquery or classic JavaScript.  Both of course are effective.  But, in this article I’m going to demonstrate another way as well.

    (more…)

  • A Fancier Twitter Timeline

    I truly enjoy the finer things in life.  For example, if I’m going to eat a steak I don’t want some fatty low grade piece of meat.  I would much rather (in this case, spend the additional money) to get an AAA grade of meat.  The taste is worth it.

    The same is true with development; the Twitter Timeline is “nice”, but I personally don’t want a linear, scrollable representation of my Tweets!  I want the AAA grade where in this case it just takes a little bit more time instead of money…  As you can see above, my Tweets are sliding in and out every 7.5 seconds.  Once it cycles through my latest 10, it restarts again.

    (more…)

  • Upgrading my Blog – The Final Saga!

    Several of my recent posts have been discussing my recent move to Amazon EC2 and updating, first to a LEMP stack, and then to a LEPP stack, which all provided great speed increases.  However, can you really be satisfied with a slightly faster loading WordPress blog, especially when my CPU was dying regularly with 100% usage?  I certainly couldn’t, especially when YSlow was giving me such a bad rating that I had really no control over…

    Firstly, a big shout out must go to Nesbot.com; he was so kind to share his custom blog code that he built using SlimPHP.  Of course I had to add a few features myself – including my fancy Twitter slider – and an importer from my WordPress blog into this new blog structure.

    If you look at the screenshot to the right, you can see  exactly when I switched two other sites to use this code on the 22nd of September!

    (more…)

  • CakePHP Global Constants and Functions

    If you ever find yourself perusing some of the default code that comes with CakePHP, you might find yourself somewhat curious and confused when you see such functions as <?php e(‘Hello World’);?> or <?pho echo h(‘<a href=””>Hello World</a>’);?>.

    I know I certainly was and became determined to understand what the heck these were doing.  It quickly became apparent that these were just two of the many built-in extension functions that are part of the CakePHP framework!

    (more…)

  • CakePHP Extending one View from Another


    A new feature in CakePHP 2.1 is the ability to make one view extend another view.  This is a very neat feature; it’s actually quite similar to the concept of Jquery template.  The concept behind it is relatively straight forward.  You define one view that contains common elements that will be updated in another view.  The goal is to avoid duplicating the HTML in a different view.

    (more…)