1. Adding GZIP Compression To Your Site Via .htaccess

    Here’s a tidbit of code for you, in a hope that this helps someone out. Paste the following into your .htaccess file and it will enable GZIP across all pages in the directory where the .htaccess file resides:

    php_value output_handler ob_gzhandler

    Hows it do it?

    This line of code sets the output handler/buffer as ob_gzhandler which autosets the ob_start() function to “ob_gzhandler” so the code doesn’t have to be entered. Normally you would have to enter this in the PHP to do GZIP Compression:

    // In the head:
    ob_start(“ob_gzhandler”);
    // At the bottom:
    ob_end_flush();

    What is GZIP?

    GZIP is a very effective way of keeping your bandwidth down when having large HTML/PHP pages. What it does is it compresses the page that’s being sent to the user viewing your site. When the user recieves this compressed version of the page it uncompresses the page on their end with the browser displaying it in full to them.

    But how much does this effect the user?

    The user gets a faster page and it doesn’t effect them in any other way.

    And what about my server?

    Your CPU usage will go up slightly for a time but then it will return to normal after 30 minutes or so of users hitting your page and the server has cached gzipped pages.

    How much of a difference does it really make?

    The answer, is roughly 80-90% of your raw code file being sent to the user is removed.

    A good implementation case study for this is Pixel2Life. Before GZIP it had a 160kb file output and after a 14kb file output. That’s a fantastic reduction in overall download size.

    Please note

    GZIP does not compress images, just the raw HTML/CSS/JS code from the site being sent to the user.

    45 Comments »
  2. The Twodded Blogs Launch and Twod Shutdown

    Today I’m pleased to announce the launch of Twodded blogs. Here multiple people will be setup with a blog to share with you their work on Twodded and other stuff along the way.

    You’ll see a lot of different things accross these blogs, and hopefully you’ll visit often :)

    Also, Twod will be taken down until the release of Twodded, which is scheduled for May 1st. Also, you may also want to note that Twodded will be a tutorials based with projects only, no funny vids, interviews or galleries (But funny pic gen/funny quote gen will remain as side projects…). Although I may want to add these galleries into the blogs for people to put their own pictures up :)

    Work on Pixel2life v2 is coming along very well, and I can promise you that you will LOVE the new version.

    Discuss This Article »
  3. Tutorialseek

    I forgot to mention, I finished one of the four projects i had going on, more specifically TutorialSeek :)

    TutorialSeek is the “tutorials only” site for Pixel2life and is a very big preview of what’s to come for Pixel2life v2.

    The enhancements with this version are as following:

    • All new tab system navigation! Individual tabs lead you to the major sections of the site. We felt this would make the entire site MUCH easier to browse and use no matter what you are looking for.
    • Less images! The site uses WAY less images so it loads faster. Up to 4 times faster than the current pixel2life.com website!
    • Random tutorials! If you’re a webmaster that has old tutorials submitted to the index and you think no one is seeing them, you’ll love this new feature! Each category view now has 5 random tutorials displayed at the bottom of each page
    • BOOLEAN SEARCH! No more exact match folks!!!! We now use the full Boolean search method for search for your tutorials! That means more matches and better chances of finding exactly what you need much faster than before.
    • Multiple tutorial submissions! Have 10 tutorials you want to submit for one category? Well now you can submit all 10 in one swoop instead of doing it one at a time!
    • Not sure which tutorials require avatars when submitted? The new submission system has you covered with it’s required avatar system. If a tutorial category requires and avatar, the “No avatar” option is no longer displayed.
    • The ultimate Source Site Summary! Remember how the old webmaster page would only show the tutorials for a particular website for one category? Well now this extremely advanced tutorial source site summary page will display every tutorial for all categories AND give you valuable stats regarding your tutorials! Webmasters can now see at a glance how many tutorials they have in the system, how many are waiting for approval, how many are approved and in the queue, total categories they have tutorials in, total tutorial views, average difficulty, average rating, and total votes!
    • Over 30 bugs that were causing some listing related panics are now gone.
    • DOUBLE THE CATEGORIES! We’ve added TONS of new categories that have been requested to us over the last few months!
    • Smart category display! When you select a category from the listing on the left, the category and sub categories will automatically move to the top of the category list, so it’s easier for you to use the sub categories without having to scroll down each time!
    • New contact form that makes it easier to report issues and comments to the right people! By selecting the correct topic, the person responsible for that subject receives your email right away.
    • A new complete Sitemap! Lost? Click the sitemap for a complete listing of every link on the site. The listing automatically updates with any new Categories or Sub-Categories we add to the site.
    • All new approval system. When a tutorial is approved, it’s moved to the go live queue and a new tutorial is approved every 30 minutes. So your tutorial is guaranteed at least 5 hours on the main page once it’s released from the queue!
    • An all new dead link system that will allow us to correct dead link issues MUCH faster!
    • Detailed submission results! When you submit tutorials, the new output system will give you a detailed breakdown of your submission so you can easily correct errors when you submit.
    • Over 250 pages of code have been reduced to 60! Aside from the database, this entire site is a re-code from the ground up!

    So head on over to TutorialSeek right now!

    Discuss This Article »
  4. Earthquake Effect: Shake the browser using JavaScript

    Note: This post was imported from the very old Twod.co.uk post archives. Please for the love of jeebus don’t use this script. Back in 2004 as a youngster this was fairly funny.

    Update: An updated and (actually) working version has been posted on StackOverflow

    This snippet of code will produce a JavaScript function which you can then attach via a JavaScript call and shake the user’s Internet browser.

    Place this anywhere before you’re going to call the function, or remove the surrounding <script> tags and place it within an external JavaScript file.

    <script type=”text/javascript”>
    function shake(n) {
    if (parent.moveBy) {
    for (i = 10; i > 0; i–) {
    for (j = n; j > 0; j–) {
    parent.moveBy(0,i);
    parent.moveBy(i,0);
    parent.moveBy(0,-i);
    parent.moveBy(-i,0);
    }
    }
    }
    }
    </script>

    An example of this function being called using the onclick method would look as follows:

    <input type=”button” onclick=”javascript:shake(200)” value=”Shake Me!” />

    This will produce (go ahead, click for an example of the effect):

    1 Comment »
  5. The birth of Twod.co.uk

    This post marks the official start of my internet presence. Twod.co.uk was my original domain registered on the 1st of March 2003 and started my exploration of the internet through development and design.

    The original Twod.co.uk site featured a forum which grew to over 10,000 posts and 1,000 members in under twelve months. Interviews with industry figures who I admired featured as well as groups of articles covering topics like .htaccess, CSS, PHP, XHTML and even Photoshop.

    It was extremely enjoyable, but I’m afraid very few posts from that original site have made it into the dynamic archives of this site. I will however try to port across as many as possible when and if I can. If you have a request for a post that is lost – please let me know and I’ll try to get it back up for you.

    Discuss This Article »