This doesn't work, because candidates can (and apparently do) lie.
I've interviewed people who have a pointer to a github account that has reasonable code, who then cannot code something basically as easy as fizzbuzz.
I assume it's because they lie about that being their github account, though maybe it's because they need an IDE to code a single stateless loop.
Edit: or maybe they just haven't coded in >years, and have forgotten how? I don't know.