Is it okay to send a thank-you-for-teaching to a professor who taught a course a few semesters ago?
Yes, it is entirely appropriate and will be appreciated. Let the person know a bit about your current activities - especially successes.
Even better, if it weren't for the pandemic, would be to pay them an in-person visit during office hours. Too few people get a chance to thank their important mentors, I'm afraid.
Yes it is entirely appropriate. Good unsolicited comments from students are always useful when one has to fill out annual reports or other such paperwork.
You might care to also include their immediate superiors (Chair or Dean) in the list of recipients to maximize the impact of your email.
I think that a general thank-you email is absolutely okay. Moreover, I think the professor will most probably be really glad to hear a thank you not from fresh graduates who simply liked the course, but from a person who obviously found the course really useful and applicable for whatever they are doing. You may want to include what you have done, why you worked on it, show some results, etc.
Also, a good idea will be to link it all to the course (e.g. "I found this and that topics really useful", or "I followed books A and B that you recommended, the former seemed too formal to me, but the latter was very useful", or "You did not mention Foobar transform, but this was what made everything very easy"). After all, this is probably the information that the professor really wants to hear, as such a feedback will allow them to do any adjustments to their course.
However, I would suggest you not to include specific details such as a GitHub link or source code attached. I'm not a professor, but I teach programming and algorithms to high school students, and I always find it a bit awkward when my former students send me some of their new code. What do they expect me to do with it? Do they want me to review the code, give some suggestions, etc.? If yes, then most often I would not be able to do such a review, yet alone just read the code. If not, then why include the code?
Of course, I can skim the code and just reply something like "Thanks, this looks great", but this seems to be not correct, because I did not really study the code and can not say that it is great. Moreover, in my course I'm rather strict about code quality, and so saying that some code is "great" without thoroughly reviewing it is below my standards...
What I am really glad to know is that the students have found my course useful in real life. I'll be glad to know what specific parts of the course were especially useful. I'll be glad to know what are they working on, and even discuss any specific questions they may have. But sending a large code without a specific request puts me in an awkward position. Think of it as of posting that huge code to Stack Overflow...
So don't include the code or any other information that may require a great deal of attention from the professor. If the professor will be interested, they would ask for the details they want.
This may be cultural, of course.