If this was taken in the USA, this is a Garter Snake (Thamnophis). There are any different species of Garter but all are harmless. The head-shape rule is largely useless because nonvenomous snakes often flatten their heads to take on a triangular shape when they feel threatened.
It looks like a diamond back rattlesnake, although I've never seen one with that dark a head before.
Best thing to do is take or email the picture to your local extension office (Google your nearest university+'extension services' to find the one in your area) because they'll know for sure what you've got.
In the meantime. avoid the area where you saw the snake, and review these suggestions for peaceful coexistence with venomous reptiles (who actually are your friend because they eat rodents and other pesty things-the presence of the snake could be a warning that you have their preferred menu around your home). These tips are written for an Australian audience but having grown up in snake country (US desert south-west) I can assure you the tips are perfectly valid where ever you and that snake are living:
http://www.derm.qld.gov.au/wildlife ... dlife/snakes/living_with_snakes.html
Add your voice to the conversation. Click here to answer this question.