physics student here, hoping to demystify what's going on in this cool demo:
forces on the ruler are in red, torques on the ruler are in blue.
for simplicity the forces and torques on the hammer are omitted.
the force of tension from the weight of the hammer through the string (Ft) exerted on the ruler is balanced by the normal force up from the table (Fn). normal force is the force exerted, for instance, on your hand when you press on a solid, which prevents you from compressing the material as you would a semi-solid like clay. forces are equal and opposite. no problem here.
however, what's more interesting is the the ruler doesn't rotate; it won't flip off the table. rotational motion is caused by TORQUES, which is a force at a distance from a point of rotation. what's cool about torques is that T = F * r or that a small force at a large distance away from the center of rotation (utilising a large lever arm) exerts the same amount of torque as a large force closer to the point of rotation. think how crowbars work. in this example, the center of rotation or pivot point is the point where the ruler rests on the edge of the table.
for no rotation to occur, torques must also be equal and opposite. the weight of the hammer is providing a large force close to the pivot point, but only provides a small amount of torque. this torque is clockwise from our reference point because the applied force is down. the handle of the hammer is actually causing an upward force at an angle theta with respect to the ruler, which exerts a smaller force at a right angle with the ruler, upward. this smaller force at a longer distance in the opposite direction supplies to equal and opposite torque, so the system remains in equilibrium.
physics is pretty sweet