Directories-755
Files-644
New directories uploaded to your domain should have the permissions set to 755 so that they can be executed by your scripts. There is no need to use 777 permissions for any directory when on our servers.
If a developer tells you that you need 777 permissions on a directory in order for their software to function, please contact me.
777 permissions are not theoretically safe.
You should set permissions for all files uploaded to your domain, to 644