Phrase derived from the French "Gardez l'eau", meaning "look out for the water".
One of the charming traditions of Edinburgh, particularly in the Old Town, was to throw the day's slops out of the window onto the pavement below. Fair warning was given by shouting, "Gardey loo!"
If anyone was passing below, they would shout "Haud yer hand!" to buy enough time to duck into a doorway.
The custom died out with the introduction of sewers and outhouses in the mid-19th century. It is not sorely missed.
Until 1998, a sewage ship called the Gardyloo took daily trips out of the Firth of Forth to dump waste in the North Sea. It was, astonishinly enough, a popular tourist trip.