Those two were beloved standards in the residence hall house I lived in, though the shaving cream was generally loaded into in large manila envelopes and "fired" by a three-man crew (one on each side to hold the corners down, and the central stomper).
Another favorite was placing "bang snaps" (or "poppers") between the top of the toilet rim and the small protrusions on the underside of the toilet seat; a small wad of toilet paper was placed to prop up the seat imperceptibly and keep the bang snap from detonating. Victim sits down and the the pyrotechnic goes off from the pressure. People would get wise to it and check for the loads, but eventually they'd grow complacent and the cycle would start over.
That house was all-male in those days, and consisted largely of engineering students, so there was a good deal of elaborate pranking that sometimes got downright dangerous. One of life's mysteries is how fast a person can go from being an enraged prank victim to an enthusiastic pranker.
Pranks?
vengeance is mine saith the engineer.
that was my freshman year and my roommate was a sophomore who told me stories of the previous year, which almost got a couple of guys kicked out of the dorm. Two of them went to the quad, where construction crews were paving the whole thing with bricks. They brought a couple wheelbarrows full of bricks up the the 9th floor and bricked in their opponents’ door.