Include personal scripts & algorithms in scientific paper
Yes to both, though providing code through a service like GitHub may be preferable as you can obtain a citable DOI and your readers will know where to find updated code, if any. Figshare is another option. Providing code in your supplement can provide redundancy, especially if you would like readers to cite your paper when they use your code. See Rule 8 under these Ten Simple Rules for Taking Advantage of Git and GitHub for more details.