Backup Battery for pi

lets say you put a pi in your car, or in your room but your power goes out or you turn your car off?

well, you could always use the GPIO pins and some extra gear to safely setup a backup power source for the pi! ... and if you know how, you can even set them up to auto safely turn off after hitting a certain power thresh-hold. :)