This is fun.
The basic definition for deus ex machine is a plot twist that resolves an impossible conflict too perfectly--as if God stepped in to straighten the worst plot tangles a writer can create. Some common examples:
- a writer painting himself into a corner
- the officer showing up to save the kids in Lord of the Flies