Blogs

Awesome Collection Of Cheatsheets For Web/Graphic Designers & Web Developers

I just want to share one of the greatest Web Design, Graphic Design and Web Development Cheat Sheet collection I've found. In this web site you'll find a nice and comprehensive list of available cheat sheets for different "Web Design", "Graphic Design" and "Web Development" purposes.

Bellow is a list of the main topics you'll find there:

Playing with PHP: The FizzBuzz test and a simple recursive factorial function

Today I was bored as hell, so I decided to implement the (in)famous "FizzBuzz" test using PHP, and bellow are the results (boring as hell too, I know!). Also, looking for information about "Recursion" in PHP I found this interesting tutorial from Devzone.Zend.com:
<?php
     // Return the PHP version of the FizzBuzz test results:
    for ($i = 1; $i < 101; $i++) {
        if ($i%3 == 0 && $i%5 == 0) {
            echo 'FizzBuzz (' . $i . '), ';
        } elseif ($i%3 == 0) {
            echo 'Fizz (' . $i . '), ';
        } elseif ($i%5 == 0) {
            echo 'Buzz (' . $i . '), ';
        } else {
            echo $i;
        }
    }
?>
// The FizzBuzz test results:
1, 2, Fizz (3), 4, Buzz (5), Fizz (6), 7, 8, Fizz (9), Buzz (10), 11, Fizz (12), 13, 14, FizzBuzz (15),
16, 17, Fizz (18), 19, Buzz (20), Fizz (21), 22, 23, Fizz (24), Buzz (25), 26, Fizz (27), 28, 29, FizzBuzz (30),
31, 32, Fizz (33), 34, Buzz (35), Fizz (36), 37, 38, Fizz (39), Buzz (40), 41, Fizz (42), 43, 44, FizzBuzz (45),
46, 47, Fizz (48), 49, Buzz (50), Fizz (51), 52, 53, Fizz (54), Buzz (55), 56, Fizz (57), 58, 59, FizzBuzz (60),
61, 62, Fizz (63), 64, Buzz (65), Fizz (66), 67, 68, Fizz (69), Buzz (70), 71, Fizz (72), 73, 74, FizzBuzz (75),
76, 77, Fizz (78), 79, Buzz (80), Fizz (81), 82, 83, Fizz (84), Buzz (85), 86, Fizz (87), 88, 89, FizzBuzz (90),
91, 92, Fizz (93), 94, Buzz (95), Fizz (96), 97, 98, Fizz (99), Buzz (100),


<?php
// Recursive factorial function
function factorial($number) {
    if ($number < 0 || !is_int($number)) {
        return 'NULL: Negative numbers and strings aren't allowed!';
    }
    if ($number < 2) {
        return 1;
    } else {
        // return factorial(6) is (6 * factorial(5)) - return 6 * 5 * 4 * 3 * 2 * 1;
        return ($number * factorial($number-1);
    }
}

// Return a factorial calculation from the factorial() function...
$factorial = factorial(6);
echo $factorial;
?>
// Factorial calculation results:
Factorial result: 720

Twitter User Finder JQuery Bookmarklets

Looking for something fun to do I just discovered this interesting post Make Your Own Bookmarklets With jQuery by Tommy Saylor from SmashingMagazine.com and decided to give it a try.

Search Engine Optimization (SEO) Copywriting Report

The truth about SEO is that it's not about trying to trick Google, it's about solid copy arranged in an search engine friendly way.

Brian Clark of Copyblogger has released a free 28 page report on how SEO copywriting can help you rank in search engines.

You'll discover:

How to install a LAMP Server and Netbeans in Ubuntu 9.10 (Karmic Koala)

This is a basic guide on how to install a LAMP (Linux - Apache - MySQL - PHP) Server and set up a PHP development environment using Netbeans in Ubuntu 9.10 (Karmic Koala)

I. Install a LAMP Server in Ubuntu 9.10 (Karmic Koala):

  1. Run this command in a terminal: sudo apt-get install lamp-server^
    1. Please note the special character "^" after "lamp-server", this character must be included
  2. Follow the MySQL password creation instructions

IE screen resolution problem solved: Javascript to detect the screen resolution

The problem:

Recently I was having problems making this page look the same in IE(7) using different resolutions, 1920 x 1200 and 1280 x 800.

The solution:

I used this little bit of Javascript code to fix it:

Syndicate content

Drupal books