Icons from apps stuck in latte dock

After removing some apps their icons still stuck in the the dock. I´ve seen somewhere in the forum a post with a script to clear that but I don´t know what to search for.