Is it ethical to make a copy of my work's source code, for the sole purpose of my own reference? By reference, I mean as reference where I can refer to it about how I (and my teammates) implemented various design patterns, architecture, etc. It does not contain any trade secret, product, secret algorithm or anything like that.
Note that I wrote many parts of the source code, and also the added value from me studying the code will also indirectly benefit the company I am working on.
I think keeping a code example reference library from job to job is a good idea. It should be better than Google. I would encourage it if I was a boss.
tell your collegues about it and especially your boss
don't hide it, but you don't have to have it open on the net either.
ask about anything proprietary
exclude sensitive data and project names
Instead of having very broad design examples, I normally have a few lines of code or blocks to reference. A Factory Pattern example maybe but how much code is it going to take to show how to do BDD? There shouldn't be a complete application here.