(I oftentimes add notes to where I took config bits even in my private my-eyes-only repos to have some breadcrumbs).
I'm not much of a coder anymore (and even then, it was self-taught hobby projects) but this is soooo good to do aside from just giving credit. I'd leave comments "I learned about this from here: (link)" so I could go back and reference it later.
I made a simple batch script to generate project folders at work and then a year later our standards changed....I would have had to start from scratch if not for the links I left because I forgot everything I learned