I've never tried this myself yet, but looking hard at it, I think it could be for real. For the ruler to fall, the hammer head would have to rise.
Come on, think about it properly. The angles are irrelevant. The balance point (or fulcrum if you want to get scientific) is the edge of the table. Now for it to balance like that both sides of the fulcrum must weigh the same (doesn't matter how they are arranged). Here you have one side which weighs the same as about 1/20th of a plastic ruler, the other side weighs the same as nearly a whole ruler plus a hammer.
Unless of course it's glued as it probably is here
Come on, think about it properly. The angles are irrelevant. The balance point (or fulcrum if you want to get scientific) is the edge of the table. Now for it to balance like that both sides of the fulcrum must weigh the same (doesn't matter how they are arranged). Here you have one side which weighs the same as about 1/20th of a plastic ruler, the other side weighs the same as nearly a whole ruler plus a hammer.
Unless of course it's glued as it probably is here
I thought about it properly, and it seems my applied logic is more reliable than your balance points, fulcrums etc.
For it to fall, as I said above, the hammer head would have to rise, which it can't do.
It's about centre of gravity, and you can shift the center of gravity by moving the cord.
A balance point is found every time.
No glue, no trick photography, no wires, and the hammer head is not touching the wall.