Category Archives: Code

Compile Node.js 4.0 on CentOS 6

Node.js 4.0 just came out, but since I’m forced to operate on a CentOS machine I was saddened to see this: WARNING: C++ compiler too old, need g++ 4.8 or clang++ 3.4 (CXX=g++) …when attempting to configure. (I learned long ago that yum wasn’t the way to go with Node. There are also problems with

Read More..

Keyword spam: Integrating should.js BDD unit tests into WebStorm for node.js

What a title. Ugh.

I spent a while trying to figure out if there was a way that I could use should.js BDD-style asserts and have WebStorm’s integrated test runner understand the results. It appears that nodeunit is integrated nicely, but you have to write nodeunit tests. Here’s a little hack I came up with to let me use should.js…

Read More..

Balanced shuffle in Javascript

Not that I’m prone to posting a lot in the first place, but I’ve been pretty busy writing code for a while now. I was loading up some music before getting down to business and needed a new shuffle to include all the new music since I last generated a playlist… but the code that does my shuffles is old and written in mIRC script. Well, I’m getting quite comfortable with Javascript now, and I’ve read about these new fancy APIs, plus I have no idea what I did with the .mrc file. I ┬ádecided to write it up in JS.

Read More..