Triplanar mapping from Local Space - problem when scaling. How to make it work?

A complete solution for Object Aligned Triplanar Material was given by [bgolus] Ben Golus here:

Big shout for Ben Golus, truly a Valhalla level of work!

Also I found second solution from Arkiras