1.
Some people say ~ to indicate that they are very surprised by something. (INFORMAL, OLD-FASHIONED)
‘Golly,’ he says, ‘Isn’t it exciting!’
EXCLAM feelings
2.
Some people say by ~ to emphasize that something did happen or should happen. (INFORMAL, OLD-FASHIONED)
By ~ we can do something about it this time.
EXCLAM emphasis