平时不烧香,临时抱佛脚 píngshíbùshāoxiānglínshíbàofójiǎo to panic at the last minute
literally meaning to never burn incense when all is well, but to clutch at Buddha's feet when in a crisis; used to describe neglecting preparation until the last moment and then acting in a panic