Definition - used in Edinburgh as a warning cry when it was customary to throw slops from the windows into the streets
Gardyloo is widely supposed to have been taken from French, although it is uncertain whether it comes from an actual French phrase (such as garde à l’eau!, “attention to the water!”) or if it was a mocking and mistaken imitation of that language. The words appears to have been in use since the late 18th century, and in early use tends to refer more often to defenestrating the contents of a chamber pot more than kitchen slops.
And behold there is nurro geaks in the whole kingdom, nor anything for poor sarvants, but a barrel with a pair of tongs thrown a-cross; and all the chairs in the family are emptied into this here barrel once a-day; and at ten o’clock at night the whole cargo is flung out of a back windore that looks into some street or lane, and the maid calls gardy loo to the passengers, which signifies Lord have mercy upon you!
— Tobias George Smollett, The Expedition of Humphry Clinker, 1771
Despite this word coming from the British Isles, the fact that it ends with a -loo and deals with toilet products has nothing to do with the fact that some speakers of British English refer to the toilet as a loo. The origin of the toilet loo is unknown, and the word does not come into common use until well over a century after gardyloo.
The people who sing Gardyloo,
As we run down the street;
And think the blessed air of heaven
Did never smell so sweet
— The Standard (London, Eng.), 17 Aug. 1827