HTTP connections on a server with only ssh access

If you ever need to set up outgoing http connections on a server and you only have ssh access, you can use squid as a proxy on your local machine. Here's how.