Instead what worked really well for me is to find a practical problem that I wanted to solve (maybe with the goal of making money from it). It turns out that just about any interesting project that you dream up for yourself will have aspects that are outside of your current knowledge/ability. Then as soon as you hit these parts start looking for reference materials, documentation or tutorials specifically related to this problem. Before you know it you're learning new stuff.
And the upshot of this approach is, that if you stick with it you may end up with a functional product at the end, which you can sell.
Also read other people's code. I find it really humbling to read well crafted code. It also motivates me to continue refining my own code.