This is the art of slapping together a solution to a problem at the last minute, with no advanced planning, and no resources. It's the coat hanger you use to fish your car keys out of the toilet, the emergency mustache you hastily construct out of pubic hair.
What's interesting about desenrascano (literally "to disentangle" yourself out of a bad situation), the Portuguese word for these last-minute solutions, is what is says about their culture.
Where most of us were taught the Boy Scout slogan "be prepared," and are constantly hassled if we don't plan every little thing ahead, the Portuguese value just the opposite.
Coming up with frantic, last-minute improvisations that somehow work is considered one of the most valued skills there; they even teach it in universities, and in the armed forces. They believe this ability to slap together haphazard solutions has been key to their survival over the centuries.
Don't laugh. At one time they managed to build an empire stretching from Brazil to the Philippines this way.