I stop smoking grass when I want to feel motivated. It's pretty simple now actually. I'm an hourly user basically (if that could even be the term lol) so whenever I take a small break of few hrs I'm all pumped up and ready to do shit.
But before all that, I'd just watch some motivational videos or any kind of videos about the specific area I am interested in, might sound cheesy but ye, other people's achievements and just daydream about all the nice stuff that could happen if you work towards a certain goal. Look at the endgame, and remember that being un-motivated is only preventing YOU from achieving certain desired goals.
Want more money, more stability and overall more knowlege about the coding that you so passionately (used to, atleast) do? Then go for it.
Gym? If there's nothing physically stopping you from going there you should be furious about not going. Be mad at yourself, you broke your OWN "rule" of going to gym, and who are you at the end if you can't even abide by your own rules. Your body is a temple, it's basically all you've got - treat it like a fuckin temple. Think about all the babes that will be drooling when they see you on the beach (and some occasional boys). Think about all the babes that WONT be drooling if you stop going to gym, and instead will ride someone elses cock.
Showering? Idk, if I don't shower for 24+ hrs I can't function properly so there's not much I can tell you about that.
Might just be a phase, but you might be losing interested in the areas of life you're into right now. Try switching something up, trying something new, new investment, new project, new hobby, new activity. Heck, even new people (Not that you should abandon your old friends lol).