[临时抱佛脚 / 臨時抱佛腳, lín shí bào fó jiǎoㄌㄧㄣˊ ㄕˊ ㄅㄠˋ ㄈㄛˊ ㄐㄧㄠˇ] lit. to clasp the Buddha's feet when danger arises (成语 saw); fig. to profess devotion only when in trouble; doing things at the last minute; making a hasty last-minute effort#53471
[功败垂成 / 功敗垂成, gōng bài chuí chéngㄍㄨㄥ ㄅㄞˋ ㄔㄨㄟˊ ㄔㄥˊ] to fail within sight of success (成语 saw); last-minute failure; to fall at the last hurdle; snatching defeat from the jaws of victory#61795