The day has come, Kinja finally supports syntax highlighted code in posts!

Usage

<pre><code class="scala">/* insert scala code here */</code><pre>

Javascript

/** * Handle errors coming from the error event, includes validation and server error messages * @param {Array} errors */ handleErrors: function (errors) { // hide existing errors this.$el.find('.js_editor-error').addClass('hide'); // display the new ones! _.each(errors, function (error) { var message = (error.message || 'generic-post-error'); this.$el.find('.js_editor-error[data-reason="' + message + '"]').removeClass('hide'); }, this); }

Scala

object abstractTypes extends Application { abstract class Buffer { type T; val element: T } abstract class SeqBuffer { type T; val element: Seq[T]; def length = element.length } def newIntBuffer(el: Int) = new Buffer { type T = Int; val element = el } def newIntBuffer(el: Int*) = new SeqBuffer { type T = Int; val element = el } println(newIntBuffer(1).element) println(newIntBuffer(1, 2, 3).length) }

Shell output

shadow:~$ sudo rm -rf / shadow:~$ ls -l /bin ls: /bin: No such file or directory