We got hit by one 1,200 years ago.
It came from two colliding Neutron Stars from a few thousand light years away and scientists were just now able to pick it up because of the existence of carbon-14 in tree rings.
What did it do around the year 775 AD? Pretty much nothing. The estimate two-second blast had really zero effect on the earth since the most high tech thing on the planet at the time was the castle and the crossbow. Had that blast happened today we would be in some serious trouble since it would short out power grids and knock out all of our satellites. If the blast happened from say, 100 light years away, we would have been a crispy cinder.
These gamma ray bursts were the result of the creation of a black hole from the collision of the Neutron Stars. So you'll have to excuse science for taking a while to figure this mystery out since there's no evidence visible. Had it been a supernova, people would have seen it in the 700s because it would have been so bright it would have been visible during the day. Had it been a solar flare, it would have been the largest flare every recorded. The black hole theory pretty much settles everything.
Except, when is this going to happen again?
(Buy this awesome book on space by Neil deGrasse Tyson - the guy that killed Pluto.)