The best piece of advice I ever got from a supervisor was this: "Succeeding in academia (he was talking about a grant, but getting a position applies too) isn't just about being brilliant, it's about hard work AND getting lucky. Not getting the grant doesn't mean you aren't brilliant or didn't do the work, it just means you weren't ALSO lucky, this time."