Skip to content

Instantly share code, notes, and snippets.

@JackDanger
JackDanger / forgetful.js
Created June 22, 2010 00:28
forgetful.js
// Forgetful.js is what I use on SSDs to prevent disk wear.
// Because each SSD sector can only be written a set # of times
// it's important not to write huge log files for no reason.
// So my test logs (and some others) are all outputted to this
// node.js instance which keeps track of the throughput
// in simply-named channels.
//
// To use this in, e.g., Rails, put this in environments/test.rb:
//
// class NamedChannelSocket < TCPSocket