Captain's Log

When you're writing code it's easy to lose track of what you did and when you did it. By timestamping your notes and writing them to a yaml file containing the raw text, you can keep your notes and grep them too.

/code

By using the /code prefix, you can save and view multi-line code blocks. You can even use specific the language name (eg: /java, /ruby) to get syntax highlighting in your code block.

Highlightable languages:
  • objectivec
  • ini
  • bash
  • xml
  • perl
  • markdown
  • python
  • cs
  • nginx
  • http
  • sql
  • apache
  • php
  • java
  • cpp
  • javascript
  • ruby
  • diff
  • css
  • makefile
  • coffeescript
  • json

.yaml

All log entries are stored as multi-line values in yaml, so you can grep from them on your host machine, without worry about encoding.

Example File:


lines:
  - code: false
    language: false
    line: Some plain text
    time: 'Sep 20 2015, 2:46 pm'
    timestamp: 1442778362269
  - code: false
    language: false
    line: 'And now for some code!'
    time: 'Sep 20 2015, 2:46 pm'
    timestamp: 1442778370893
  - code: true
    language: javascript
    line: |-
      app.on('window-all-closed', function() {
        app.quit();
      });
    time: 'Sep 20 2015, 2:46 pm'
    timestamp: 1442778386045
  - code: true
    language:
      - python
    line: |-
      def weighted_choice(choices):
         total = sum(w for c, w in choices)
         r = random.uniform(0, total)
         upto = 0
         for c, w in choices:
            if upto + w > r:
               return c
            upto += w
         assert False, "Shouldn't get here"
    time: 'Sep 20 2015, 2:46 pm'
    timestamp: 1442778396558