Archive for the ‘Techniques’ Category

Rules for High Performance Websites

Tuesday, October 30th, 2007 |

Here’s an excellent article on Yahoo on how to speed up your website.  The points covered in this are:

  • Make Fewer HTTP Requests
  • Use a Content Delivery Network
  • Add an Expires Header
  • Gzip Components
  • Put Stylesheets at the Top
  • Put Scripts at the Bottom
  • Avoid CSS Expressions
  • Make JavaScript and CSS External
  • Reduce DNS Lookups
  • Minify JavaScript
  • Avoid Redirects
  • Remove Duplicate Scripts
  • Configure ETags
  • Make Ajax Cacheable

Read on at: Best Practices for Speeding Up Your Web Site

Here’s a Firefox plugin from to grade your site performance according to the rules outlined in this article:

YSlow for Firefox: http://developer.yahoo.com/yslow/

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

Screen capture with PHP and GD

Wednesday, April 18th, 2007 |

Pierre shows you how to get a screen-shot of a site using PHP and GD2 on Windows. The examples he’s presented shows you how to get a screen shot of IE, and goes on to show how to get a site loaded into IE and capture the screen only after the page loads completely on the browser.

This method can be used to capture any kind of window.

Link: Screen capture with PHP and GD - The Pimp

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

How to get around Google Filters

Monday, February 5th, 2007 |

 Google

Here’s a great article from Joe Whyte which lists out the possible filters which might be causing your site to go off the search listing at Google.  He also lists out steps on how to get your site off these “filters” and back in the search results again. Some of the filters include:

  • Google Sandbox - Where most new sites get stuck in
  • Google Duplicate Content - Pages in your site containing the same information all over.
  • Link Farming Filter
  • Page Load time - It seems that the bots skip pages which take too long to render !
  • .. and lots more.

Here’s the link to the article: Google Filters, how to get around them and exploit their loop holes | Joe Whyte

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

PHP Upload Meter

Thursday, December 14th, 2006 |

Justin Silverton shows how to create an Upload Progress meter using PHP 5.2 and Yahoo User Interface. Prior to PHP 5.2, there’s no way a PHP script could monitor the progress of a file upload, causing programmers to look at Perl scripts to provide the same information. For a demo, head over to http://progphp.com/progress.php
This progess meter is based on the yahoo user interface library and alternative php cache (APC). You will need both of these for it to display properly. PHP 5.2.0 or higher is also required. (I have written a previous article on alternative PHP cache here). 

Jaslabs: High performance php » How to create a php upload progress meter

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

High Performance PHP

Thursday, October 12th, 2006 |

Did you know that the fastest way to check in PHP to see if you’re running on windows is:

$iswindows = DIRECTORY_SEPARATOR == '\\\\';

or the fastest way to get the time without even calling a function is:

$currenttime= $_SERVER['REQUEST_TIME'] ;

These are some of the optimization methods mentioned over the slides by Ilia Alshanetsky on High Performance PHP. Browse the slides to learn more optimizations you can perform on your code to improve performance:

http://ilia.ws/files/ez_performance.pdf

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

Dynamic PHP

Monday, September 11th, 2006 |

Another did you know in PHP.

< ?
function test() {
echo "This function can be called dynamically!";
}
$function_name = "test";
$function_name();
?>

What is the output of the code show above? If you guessed that the output is “This function can be called dynamically!”, you may be a PHP guru. :)

The code shows you how to dynamically call the function test without actually calling test(). This method of calling a function could be useful in complex applications where you have to call on a function dynamically from you code.

Here’s a tutorial which shows you how to use :

  • Dynamic Vairables
  • Dynamic functions and objects
  • Dynamic static properties and methods

When you’re trying to build more complex classes/applications, the need for doing things dynamically often arises. I figured I’d compile a list of ways to do dynamic PHP for those starting out with PHP. Please note that the list was elaborated with PHP 5 in mind.

Link: epiphantastic » Blog Archive » Dynamic PHP

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

GROUP_CONCAT in MySQL

Tuesday, September 5th, 2006 |

GROUP_CONCAT(expr) - This function returns a string result with the concatenated non-NULL values from a group.

Where it can be useful?

For example to get PHP array without looping inside PHP:
CREATE TABLE services (
id INT UNSIGNED NOT NULL,
client_id INT UNSIGNED NOT NULL,
KEY (id));
INSERT INTO services
VALUES (1,1),(1,2),(3,5),(3,6),(3,7);
SELECT id,client_id FROM services WHERE id = 3;
+----+-----------+
| id | client_id
+----+-----------+
| 3 | 5
| 3 | 6
| 3 | 7
+----+-----------+
SELECT id,GROUP_CONCAT(client_id) FROM services WHERE id = 3 GROUP BY id;
+----+-------------------------+
| id | GROUP_CONCAT(client_id)
+----+-------------------------+
| 3 | 5,6,7
+----+-------------------------+

Read more: MySQL Performance Blog » GROUP_CONCAT useful GROUP BY extension

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

ORDER BY … LIMIT Performance Optimization

Monday, September 4th, 2006 |

An interesting read from Peter Zaitsev about optimizing MySQL queries which use ORDER BY with LIMIT.

Suboptimal ORDER BY implementation, especially together with LIMIT is often the cause of MySQL Performance problems. Here is what you need to know about ORDER BY … LIMIT optimization to avoid these problems

Read on: MySQL Performance Blog » ORDER BY … LIMIT Performance Optimization

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

Mapping in PHP using GD

Tuesday, August 29th, 2006 |

If you want to plot Geographical data on a map and want to do it without integrating with third-party API’s like Google Maps, here’s an article which shows you how.

The article shows you how to plot points on a map using PHP and GD. The code contains a function to convert latitude and longitude values into x and y values to plot on an image. Here’s the output from a sample code I was testing based on this article:

Example of a PHP Geo map

Read the article at : PHP Examples: Mapping in PHP part 1

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

Design Patterns for Web 2.0

Thursday, June 29th, 2006 |

Yahoo’s UI Blog and Design pattern Library have interesting topics on patterns to follow while designing UI’s for Web 2.0 applications. In the old web, an action almost always followed a page reload or an intrusive Javascript pop-up, indicating that the action was complete. In the age of Ajax, how do we communicate the action completion to the user?Transitions are a powerful way to communicate change in a user interface. Transitions can communicate a change in relationships between elements on a page or a change in an element’s state. Additionally, when interactions are complex or involve important changes transitions can be used to slow down an interaction allowing the user to “see what just happened.” During lengthy processes, transitions can be used to make time seem to pass faster by distracting the user during the waiting time. 

Transition Parent - Yahoo! Design Pattern Library

With the widespread acceptance of Ajax (and the resurgence of Flash) new ways of interacting on the web have emerged. In many ways, these interactions are not new. Interactions like drag and drop and inline editing have been mainstream on desktop applications for over 20 years. What is new, though, is the emergence of these idioms on the web. 

Link: Design Pattern: Invitation

Another interesting link on this topic: Mind Hacking Visual Transitions

Bookmark and share: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • bodytext
  • StumbleUpon
  • BlinkList
  • blogmarks
  • Furl
  • Slashdot
  • Spurl
  • Technorati
  • YahooMyWeb
  • description
  • e-mail
  • Facebook
  • Google
  • IndianPad
  • Live
  • Ma.gnolia
  • NewsVine
  • Reddit
  • TwitThis

About Me

Here's my blog on stuff I keep finding on the Web. More

Want to subscribe?

 Subscribe in a reader Or, subscribe via email:
Enter your email address:  
On the Go? Get this on your Widsets: Add to my Widsets
Find entries :
Page 1 of 212»