Thankfully I don't have anyone in my area waving a huge knife in my face. The only advice I would give is don't make smart arse comments to the people who can't solve things without resorting to violence because they don't like anyone better than them.
If they just continuously target you, just call the cops. But there is also the chance that they will try and take revenge on you for doing that.
It would be probably best to take the long way home. Walking home the long way would be time consuming but it is a lot better than losing your life or getting badly injured.