Fix HTML5 range slider slide event

I was very annoyed, that there was no change event on the HTML5 range element. You only got an event on mouseup. So i decided to write a short fix:

$('input[type=range]').mousedown(function () {
  this.slide = true;
  this.lastValue = this.value;
}).mousemove(function () {
  // trigger only on mouse down and
  // when the value has changed
  if (this.slide && this.lastValue !== this.value) {
    this.lastValue = this.value;
    $(this).trigger('change');
  }
}).mouseup(function () {
  this.slide = false;
});

Tokenizer for Linux Shell (cut2)

About a year ago, i coded a little command line tool to tokenize data from a file or stdin and print each token as new line to stdout. Now you can use grep, sort or cut to manipulate the data further. As delimiter you can use any string you want and it will be left out in the result.

Sourcecode

After make copy the cut2 binary to /usr/bin/ and you can use it like every other command line tool.

Usage: cut2 -d DELIM [- | filename]

Have fun :)

update: improved code now available at github