臨急抱佛腳

Idiom

 * 1)  to do something hurriedly only at the last minute