Shulchan Arukh, Orach Chayim Siman 354
Can copy this into an AI, or connect the whole library to your assistant. For deeper learning, you can directly use the original seforim, sites, and apps.
בור ברשות הרבים וחוליא סביבו אם עומד בתוך ד' טפחים לרשות היחיד מותר למלאות ממנו לרשות היחיד אפילו אין החוליא גבוה עשרה ואם הוא רחוק ד' מרה"י אין ממלאים ממנו אלא אם כן תהא החוליא גבוה עשרה:
If there is a water pit in the public domain with an embankment surrounding it, if it is within four tefachim of the private domain, it is permitted to draw water from it to the private domain, even if the embankment is not ten [tefachim] high. If it is four tefachim away from the private domain, we do not fill from it unless the embankment is ten tall.
אשפה ברשות הרבים שגבוה עשרה ורחבה ארבעה אם היא של רבים מותר לזרוק לה מרשות היחיד הקרוב לה: הגה ולא חיישינן שמא יתגלגל מן האשפה לר"ה ואתי לאתויי דאין דרך לזרוק לאשפה אלא דברים מאוסים (המגיד פ' ט' בשם הרשב"א) ואם היא של יחיד אסור משום דיחיד עשוי לפנות אשפה שלו ויבואו לשפוך שם כדרכן ונמצאו שופכים בר"ה:
If a trash pile in the public domain is ten tall and four wide, if it is public, one may throw something into it from the private domain that is near. Rema: And we do not worry that the object will roll from the trash to the public domain and he will go pick it up, because one generally only throws disgusting things to a trash heap (the Magid chapter 15 in the name of the Rashb"a), and if it is a private trash heap, this is forbidden because the individual empties it and will end up emptying it regularly and pouring things into the public domain.