Best way to clear out Rails development processes

Killing errant processes for Rails Development

I can’t say how much I used these scripts, mostly pgk to kill stuff when restarting and/or switching projects:

This is part of:

However, I’m wondering if there’s a better way. I asked here as well: