CodeMirror: Autoresize demo
.CodeMirror-scroll { height: auto; overflow-y: hidden; overflow-x: auto; }
By setting a few CSS properties, CodeMirror can be made to automatically resize to fit its content.