Most restaurants have a way to signal the kitchen that an inspector has arrived and they'll quickly toss everything they are cooking into the garbage because it's cheaper than getting a fine. Former mayor Bloomberg's planned crack down on soda drinks was more about issuing fines for not serving precisely 8oz of liquid - though the next mayor dropped it and all the special order measuring cups for the health inspectors went to a warehouse.
I've witnessed a fleets of NYPD tow trucks clearing out streets of UPS and Fedex trucks. They know what time the delivery companies hit various parts of town and they are ready for them.
Recently the New York fire inspectors have started fining landlords for debris in the hallways (debris = amazon deliveries left at the door). So now if the delivery comes to the door you have to get it before the building super throws it away to save the landlord from being fined, if it gets left by the mailbox then the food delivery people steal it on their way out. No winning.
About ten years ago there was a good samaritan going around feeding parking meters to keep people from being fined. He was arrested and taken to jail. They let him go without charges but not before he spent the weekend - because the person who processes releases doesn't work on weekends they said. I think he sued and ended up settling out of court.