Imam Muhammad Al-Baqir (as) says that a Jew greeted the prophet (S) by saying assamalaik (that would mean, ‘may death come to you’). The Prophet (S) replied, “Alaik assaam (meaning, ‘May death come to you too!)” The Companions protested to the Prophet (S), “The Jew has wished for your death!” The prophet (S) replied to them, “Similarly, I have wished for his death too! By this evening he will be a dead person! A snake will bite his head!” The Jew was a woodcutter. He went to the forest and returned around sunset with a stack of wood on his shoulder.
When the companions saw the Jew they informed the Prophet (S) that the Jew was still alive. The prophet (S) asked them to call him. The Jew came to the presence of the Prophet (S), who asked him to throw the stack of wood down. When the stack was put down a snake emerged from it and ran away. The Prophet (S) asked the Jew, “What good deed you had done today?” The Jew said that he had two pieces of bread, of which he gave one to a beggar. The prophet (S) said, the alm (sadaqa) has saved you. That snake had brought the message of death for you. It had a sliver of wood stuck in it’s mouth that prevented it from biting you. The prophet (S) then said that sadaqa can ward away death. If a person wants to be safe against unforeseen difficulties, he should start the day by giving a sadaqa.
Reference :Ain-Al Hayat, The Essence of Life