I'm not giving legal advice, but I think the point of these forums is to share and learn about code. If you use someone else's code, but use different assets, I don't think there's any way someone can sue you.

However, if you take someone's photo gallery (pictures, code and all) and say "Hey guys, look what I did!" then I think they can sue you.