Rabbi Shimon Bar Yochai (who lived in the 2nd century CE in the Holy Land) was possibly the holiest man that ever lived. Besides authoring the 'Zohar', being a master of the oral Torah and a miracle worker, he was one of the few Jews in history who spent every instant of his time learning Torah; no casual conversations, coffee breaks and certainly no vacations—only Torah.

So everyone was surprised when, the day after Rosh Hashanah (Jewish New Year's Day) he showed up at the door of his nephews' home and began to lecture them about the importance of giving charity to the poor.

Although they didn't really have money to spare and totally didn't understand the urgency of what he was saying, they listened attentively; when Rabbi Shimon spoke everyone listened.

"Give with an open hand," Rabbi Shimon adjured. "Don't worry about tomorrow, G‑d will provide. And most important: write it all down. Every penny you give, write it down and carry the list with you at all times. I want to see a big sum at the end of the year."

Rabbi Shimon made them promise and he left.

Almost a year later they had another strange visit—from a posse of Roman soldiers with an order for their arrest. Someone accused them of selling silk without paying the tax to the government. They began weeping and protesting their innocence but to no avail.

Trembling with fear, they were led off to prison where they were given a choice: either pay an outrageous fine of six hundred dinar or produce an even more outrageously priced silk garment for the king, both of which were utterly beyond their means.

When Rabbi Shimon heard what had happened he immediately rushed to the prison and got special permission to visit his relatives.

"Where is the account of the charity you gave?" He asked. "How much did you give?"

"Here," they replied as one of them pulled the small parchment from his pocket.

Rabbi Shimon took the account and noticed that they had given almost six hundred dinar; they were just six dinar short. "Do you have any money with you?" he asked.

They produced six dinar that they had sewn into their garments in case they needed it. Rabbi Shimon took the money, bribed one of the officials, the charges were dropped and they were released.

Rabbi Shimon explained to them what had happened. "This past Rosh Hashanah I dozed off and dreamt that the government would demand of you six hundred dinars. That is why I told you to give charity, to negate the decree."

"Then why didn't you tell us about that?" they complained. "We would have given the money immediately and spared ourselves a lot of anguish."

"But then," replied Rabbi Shimon. "You wouldn't have done the mitzvah for its own sake."

(From Midrash Rabbah, Vayikrah 34:12)