Student or Learner
"Yes; I cared more for that dirty rag of vanity, worse than any vice, than I did for any vices. How many men have sold their souls to be admired by fools? I nearly did it, merely to be suspected by fools. To be the dangerous man, the dark horse, the man of whom families should be afraid--that is the sort of abject ambition for which I wasted so much of my life, and nearly lost the fulfilment of my love. I dawdled, I lounged about, because I could not give up a bad name. And, by God, it nearly hanged the dog."
What is meaning of 'hanged the dog'?
I found this one on the internet, too ... and it's a good thing. The snippet you quoted isn't really enough to get the meaning.
The speaker (Gahagan) was accused of murdering a man - and of sleeping with the man's wife. He didn't fight the accusations - initially. And was very nearly sentenced to die by hanging for the murder. He defended his failure to defend himself by saying that he was vain - he didn't want to admit that he was NOT the type of man that would kill another and sleep with the other's wife. It took a brush with a hangman's noose to bring him to his senses.