This is from Talmud Yerushalmi, Tractate Shabbat, Chapter 6; halacha 9 (embellished by yours truly!):
There was once an astrologer who looked up in the sky. He measured this angle and that angle and promptly declared to his friends, "See these two Jewish men walking by? They will not return!"
So everyone watched to see how will their imminent death occur. The two men were walking down a road. Suddenly, and old man appeared. He was in tattered clothing and begged to them, "Please do you have anything to eat? I haven't eaten in three days!!" Out of mercy for the begging old lman, the two decided to give him of their fig cake in the bag. The took a knife and sliced the whole bag in half and gave one half to the old man. When they were done with their business, they returned to their original location. When they opened their bag later, to everyone's surprise, they found half a snake in the fig cake bag!
The friends of the astrologer shouted, "hey! they returned!! You said they would not return!!"
"Well," snorted the astrologer, "their G-d is appeased by half a fig cake!"
There was once an astrologer who looked up in the sky. He measured this angle and that angle and promptly declared to his friends, "See these two Jewish men walking by? They will not return!"
So everyone watched to see how will their imminent death occur. The two men were walking down a road. Suddenly, and old man appeared. He was in tattered clothing and begged to them, "Please do you have anything to eat? I haven't eaten in three days!!" Out of mercy for the begging old lman, the two decided to give him of their fig cake in the bag. The took a knife and sliced the whole bag in half and gave one half to the old man. When they were done with their business, they returned to their original location. When they opened their bag later, to everyone's surprise, they found half a snake in the fig cake bag!
The friends of the astrologer shouted, "hey! they returned!! You said they would not return!!"
"Well," snorted the astrologer, "their G-d is appeased by half a fig cake!"