I second what mharroun said.
Additionally:
- having a Github project matters, but nobody looks into it the code.( nobody looked into mine, because I was never asked about it.)
- The ethnicity match matters, a interviewer from India will reject you outright if you are a local American.
- about the the luck part, I have one interesting observation. When teams are desperate the bar is much more lower. Give enough interviews and you can be assured that atleast one of them is for a position where they immediately need someone. The downside to this, is that once you get the job, you will notice that desperation for candidates most probably stemmed from a project not meeting it's deadline and the team was hoping to throw in more bodies to salvage it. You will be under tremendous pressure to deliver the undeliverable. Do not let this get to you.