For me, the single most important thing about Open Source is that it means I can solve a problem once and then /never have to solve that problem ever again/ in the future.
So any code I write I like to open source, because that's the best possible way I know of ensuring I won't have to waste time solving that same problem again.
The other thing that helps is that I think I've found a cure for project guilt.
I used to feel guilty about my projects - each one was Yet Another Thing that I should be spending more time on.
The fix I discovered was to make sure every single one of them has good test coverage and comprehensive documentation.
Effectively I treat each one as something which can stand on its own if I effectively abandon it - the thing works, and is documented, and other people can use it as-is without me feeling guilty that I'm not constantly actively working on improving it.
So any code I write I like to open source, because that's the best possible way I know of ensuring I won't have to waste time solving that same problem again.
The other thing that helps is that I think I've found a cure for project guilt.
I used to feel guilty about my projects - each one was Yet Another Thing that I should be spending more time on.
The fix I discovered was to make sure every single one of them has good test coverage and comprehensive documentation.
Effectively I treat each one as something which can stand on its own if I effectively abandon it - the thing works, and is documented, and other people can use it as-is without me feeling guilty that I'm not constantly actively working on improving it.
I wrote more about that here: https://simonwillison.net/2022/Nov/26/productivity/