Let's be real: Programmers plagiarize all the time. Especially other people's code, but it can often be from peer-reviewed journal articles, other peer-reviewed literature, literature in general, or just something off the internet.
It is in everyone's best interest to comment their code and provide where their information came from. More likely than not, you are no super-genius, and you needed this information to finish your project. It is highly unlikely that anybody can do this on their own.
It is no big deal to cite where you are getting your information. It is important in case somebody needs to review your project.