Flush REPL (also inside Atom)

I posted some code here a while ago. Haven’t used this in a while, hopefully it still works.