As long as the times favor you, march with the times. Beware that ambition does not blind you, and enmity does not deprive you of your intelligence. If a friend loosens the bond of friendship, you should strengthen such bond. If he keeps distance from you, you should try to come closer to him. If he adopts a stiff attitude against you, you should adopt a gentler attitude towards him. If he makes a mistake you should find an excuse for him. Behave with a friend as if he is your master, and you are his slave. Do not befriend the enemy of your friend. Do not refrain from tendering advice to your friend even though it might be bitter. Do not give way to anger. He who is harsh with you, be kind to him. He who has a good opinion about you, see that such opinion is not falsified. Do not ignore the rights of a friend under the false notion that he is a friend, for where rights are ignored, friendship suffers. Do not despair because of the oppression of a tyrant, for by such oppression he digs his own grave.
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari