All about what goes on behind the scenes in the R&D team at myob.

Use hilite.me to pretty print

  1. Visit http://hilite.me/
  2. Select "vim" style and turn on line numbering
  3. Press the highlight! button
  4. Click into the HTML window and copy the code
  5. Come back to your blog post and paste the code into where you like it

Fiddle the Style Sheet.

There are some overriding styles that effect the final output. So we need a little override here. Add this style to just above your code:

1  
2  
3  
4  
5
<style>  
.code-sample pre {  
    background: pink;
}  
</style>  

Sample code output

This is how it looks after you've done that.

 1  
 2
 3
 4
 5
 6
 7
 8
 9
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20
"use strict";

console.log("The invaders");  
var r = 500;  
var bulletHeight = 290;  
var shooting = false;

function moveLeft() {  
    if (r < 10) { return }
    r -= 10;
}

function moveRight() {  
    if (r > 500) { return }
    r = r + 10;
}

function repositionInvader() {  
    $("#invader").css({"left": r + "px"});
}  

The rest of your blog goes here.

How about in a GIST?

Done.

You're all done. Bask in the glory of a great post.