平时不烧香,临时抱佛脚 píngshíbùshāoxiāng, línshíbàofójiǎo last-minute effort
To neglect preparation until the last moment and then act in panic or seek help desperately; literally, to never burn incense when all is well, but clutch Buddha's feet in a crisis.