This is a mixed bag of so-called "laws", often interpreted in an unfavorable or satirical light. Because of this, you might say that none (save one) of these laws are literally laws, but they are the effects of laws that do exist. I'll do my best to sort this out.
A fine of $25 can be levied for flirting.
Almost certainly an anti-prostitution law taken to the extreme. I only found one example of a bill, but it failed, and was only tangentially related. It's not hard to imagine that at some point, flirting was technically illegal.
A license must be purchased before hanging clothes on a clothesline.
This is most likely a satire of the actual law, which probably states that you cannot hang anything out your window or in your yard without a permit. Many cities and states have rules about what you can, and can't, put on your property. These are usually related to health and/or aesthetics.
Carmel: A man can't go outside while wearing a jacket and pants that do not match.
It's too hard to track this one down right now, but that sounds like a satire of something like a specific situation where a person must be wearing specific clothing. For example, I would imagine a firefighter or school crossing guard having these requirements for safety reasons.
Citizens may not greet each other by "putting one's thumb to the nose and wiggling the fingers".
Edited for clarity
While we do have the First Amendment right to Free Speech, it is sometimes recognized in jurisdictions that certain actions and phrases may pass the "imminent lawless action" exception. It is likely some kind of ordinance that prohibits being unnecessarily rude to the point where the offender may end up being assaulted or worse as a result of the gesture. This gesture was known as early as Shakespeare, with the "I thumb my nose at thee" line, also known as the "cock-a-snook" gesture in some regions.
Of course, the actual law is probably much more nuanced than that, and this is just a funny way of reducing this law down to the most absurd example that someone could think of. Thanks to some comments, I just realized that this is very likely § 240.20 Disorderly conduct.
A person is guilty of disorderly conduct when, with intent to cause
public inconvenience, annoyance or alarm, or recklessly creating a risk
thereof:
...
- In a public place, he uses abusive or obscene language, or makes an obscene gesture; or
...
Several states have some sort of statute like this that are technically First Amendment Free Speech violations, yet generally recognized by those jurisdictions as having legal force, since the purpose is to discourage violence that can be caused by "fighting words."
Donkeys are not allowed to sleep in bathtubs in Brooklyn, N.Y.
This is likely a structural integrity joke that doesn't hold up well (sorry, couldn't resist). Floors only have limited strength. If you look up the weight of a cast-iron bathtub and the maximum weight of a full-grown donkey, you'll find it weighs just less than a ton (about 1,800 pounds, assuming a heavy tub and large donkey). Someone probably saw a law about the maximum weight you can put on a floor, then looked up how much things weigh, and the joke practically writes itself.
During a concert, it is illegal to eat peanuts and walk backwards on the sidewalks.
Again, this is probably taken out of context, but I presume that someone was doing something stupid and got hurt or killed, so a law was written about not walking on the sidewalk without paying attention to where you were walking. For example, if a sidewalk had a open manhole cover or something, and a person fell in. This is just a hyperbole example of the actual law, whatever it may be.
In New York, you can teach your pet parrot to speak, but not to squawk.
Easy. Noise ordinance law somewhere. A parrot's squawk can exceed 105 dB, and is generally disruptive to living next door to you in a thin-walled apartment. This person just found something really loud, and translated this law to match that law's prohibition. It's unlikely you'll find a law this specific, but noise ordinance laws exist in many areas. My area is 75 dB during the day, 70 dB at night.
In New York City it's illegal to shake a dust mop out a window.
That's definitely still on the books. It's part of the littering law.
Littering, sweeping, throwing, or casting any material such as ashes, garbage, paper, dust, or other garbage or rubbish into or upon any street or public place, vacant lot, air shaft, areaway, backyard, court, or alley is illegal. Throwing garbage out of windows (for example, from buildings or vehicles) is also a violation. In addition, no person may allow anyone under his/her control (agent or employee) to commit a littering, sweep- out, or throw-out violation. Merchants must put all sweepings into suitable garbage receptacles for pickup by a private carter. Residential units must put sweepings into suitable garbage receptacles for pick up by DSNY. Sanitation litter baskets may not be used for this purpose.
It is against the law to throw a ball at someone's head for fun.
As far as I can tell, this has a serious history. Carnival workers ("carnies") often had setups that involved heavy solid balls. The kind that could literally cause concussions if they were hit in the head. Dunk tanks, knock-stuff-over games, and so on. Presumably, people thought it would be funny to assault the carnies, so laws were written. Of course, assault is already illegal, but it was probably put there was a way to let people know it was a serious situation.
Jaywalking is legal, as long as it's not diagonal. That is, you can cross the street out of the crosswalk, but you can't cross a street diagonally.
This is really just saying that there's no law prohibiting jaywalking specifically, but there are laws about when you're allowed to cross an intersection diagonally. Again, making it sound weird or strange. It's just a loophole in the lawbooks. Presumably, if people started getting hit while crossing mid-street, they'd add a new law to address that.
Slippers are not to be worn after 10:00 P.M.
This is likely another oversimplification. It's probably something more like "you have to wear solid-soled shoes at night to protect your feet from broken debris and rats" or something like that.
Staten Island: You may only water your lawn if the hose is held in your hand.
This is likely a water conservation law. Automated sprinklers and lawn sprinklers waste water. In an effort to combat that problem, requiring hand-holding your hose makes you more likely to not overwater your lawn.
While riding in an elevator, one must talk to no one, and fold his hands while looking toward the door.
Of this list, this one is presumably a satire law that makes a statement about societal customs in some places of New York. It's highly unlikely this would be real law, but rather an expectation of how to behave in an elevator if you didn't want to have a bad experience.
So, overall, I'd say that virtually none of the laws actually read like they do on this list, but some variant of the law in a more generalized form probably does exist.