The first recorded instance of the phrase “cheating the devil” can be found in the Hebrew Talmud.
The devil offered a farmer two years of a flourishing harvest with the condition that the devil would get the crops grown underground for the first year, and those grown above the ground the following year.
During the devil’s below-the-soil year, the farmer grew wheat and barley.
In the above-the-soil year he grew carrots and turnips, and therefore cheated the devil.