How can I prevent texture stretching while scaling a mesh?

This seems very awesome. Bookmarking this page for sure!