The Duties of the Heart, by Rabbi Bachye, tr. by Edwin Collins, , at sacred-texts.com
It may be asked: Can pride and humility dwell together in the heart? The answer requires a definition of pride.
There are two kinds of pride. Pride in the bodily powers and in corporeal and material things; and pride in spiritual and mental qualities, such as wisdom, and in good works. All pride of the former kind banishes humility. For all pride in the things of the world implies contempt for the Lord of all good, and ignorance of the instability of these things, and the rapidity with which they may depart, and shows that the proud man thinks he is, himself, his own benefactor, and that it is his own wisdom and his own power that has gained him the acquisitions of which he is proud.
Even pride in spiritual and mental qualities is of two kinds; one shameful, and the other admirable. The shameful kind is where a man prides himself on his wisdom and the righteousness of his conduct, and it leads to his being great in his own eyes and
perfectly satisfied with himself, and to his thinking it enough if he gets a good name, and is praised among human beings; and it induces him to look with contempt on other men, and to despise them and talk against them; and to think little of the wise men of his day and of their greatness; and to glory in the failings of his fellows and in their folly. And this is what our sages mean by "glorifying one's self in the shame of one's neighbour."
The admirable kind of pride is that, when the wise man prides himself on his wisdom, and the just man on his works, he should acknowledge, in these things, the great beneficence of the Creator, and should rejoice on account of these gifts. Such pride in these gifts will then induce him to increase them and make good use of them, and to be meek with all around him; and to rejoice with his fellows, and be eager for their glory, and to cover over their folly, and to speak in praise of them, to love them, and to rejoice over them, and to be careful of their honour. Then, also, his own good deeds will appear so small in hi eyes, that he will be continually striving to increase them. He will be humble because of his sense o[ inability to attain to the realisation of his ideal in respect to them, and he will be full of gratitude to God for giving him these precious qualities. Such pride is helpful, and not harmful, to humility.