Idiom: By the skin of your teeth

See also: