Best way to get better is to just practice, practice and practice (if you want to get better). But even then, always have a snippet in some tab/window behind everything when you're presenting, so in case you get stuck, you can copy-paste a snippet you know is working. Also removes a bit of the edge as you know you have a backup.