One of the tricks is to have what you're doing - or what you're going to do - really small. This way you don't have enough time to become bored. For this approach to work, you need to be able to split meaningful projects into still somewhat meaningful, fun enough but small subprojects.
Another thing is that for many projects you're starting it understanding that you won't finish it - in one piece of time. You're going to start, progress, reflect on it, do some more - then put it on the shelf for a while. And this is ok. This allows you to actually boldly start projects which you know you won't finish - again, in one chunk. For example, I also took several courses on Coursera etc. and dropped then after a couple of weeks. But they are still high in my priorities - as soon as I can/want/return to the same subject of interest, I come back to the courses, reading the material, watching videos and even doing homework. This at least allows me, when taking that course second time (if I need to - usually I don't, the primary reason is knowledge, not the certificate) to feel right at home.
I'd say, don't throw away that list of ideas you developed while working on something - but check it, choose perhaps something out of it for the new list, may be you're still interested in some projects mentioned there.
And... you still have to be persistent at times. Don't worry - it's a source of great feeling when you actually finish something non-trivial - and only you know how hard it was, and you really learned things from that - and you know you're better because of that.