Is there an good book/pdf similar to
Elements of Statistical Learning that's available for free, online that deals with Bayesian statistics, ideally with code for
Well, given that you asked for something similar to the elements, I'm going to assume that you are of a machine learning bent.
Therefore, I would suggest the following:
Additionally, if you are looking for something a little more introductory, I would suggest Think Bayes