Caret is a code editor inspired by Sublime Text, capable of running completely offline and able to open and save files anywhere on your hard drive. It exists as a Chrome app, which means it can run on any desktop operating system, including Chrome OS.
Caret has a pretty comprehensive feature set that makes it ideal for small programming tasks. It supports tabbed editing, syntax highlighting for dozens of languages and plenty of advanced features like keyboard shortcuts, multiple cursors and editable configuration files.
Sublime Text will cost you , but Caret (and its comparable feature set) is completely free. It’s also 100% open source, so you can contribute your own patches to the project if you’re struck with the motivation to do so.