Tag Archives: process

Tips and Tricks for Lua Beginners: Writing an at.exit registry

It’s relatively simple to write a function that takes in a function and executes it once Lua terminates.

at = {}
function at.exit(fn)
     getmetatable(newproxy(true)).__gc = fn
end
Posted in Blog, Lua, Programming, Snippets | Tagged , , , , , , | Leave a comment

Auto-restart in (Python) and subprocess.Popen goodness

This is an auto-restart script for Orbited, but it can be modified to be used with other apps. This is presuming that there’s only one instance with that name running.

Basically, this script takes into account the fact that if…

Posted in Programming, Python, Snippets | Tagged , , , , , , , , , , , , , , , , , , , , , | Leave a comment