Share VirtualBox host directories with the Linux guest OS, edit code in host, run it in the guest

This short tutorial will show you how to setup one of the little intricacies when developing in VirtualBox, namely being able to store and edit your code in the host machine, while running it inside the guest OS. Will be using CentOS 7 as a guest, while the host is not of any importance.
I will also show you how to make the VirtualBox guest accessible to the host via TCP.