whird.jpope.org cover image

Simple Nodejs Express Server

Just for fun (and because I mentioned to @jonkulp that I would), here is a quick (plus slightly extended) write up on how to spin up a simple nodejs server with express.js. First, install nodejs and npm, it's bundled together in ArchLinux, not sure about other distros. In Debian, it looks like they are split. Also, in Debian, they have decided to rename the node executable to nodejs, which breaks some things. This is due to a package for a Ham Radio program being called node. If you don't have this node installed, you can "fix" nodejs by creating a symlink. $ sudo ln -s /usr/bin/nodejs /usr/bin/node At the time of this writing, here are the versions that I have installed: $ node -v v0.10.22 $ npm -v 1.3.14 Once these are installed, we'll install express globally with: $ sudo npm install -g express Next we need a directory where you would like to run the server so, create a directory where ever and navigate into it. $ mkdir express_server $ cd express_server Express has a built in function to set things up for…

Using a full image as html background

As some of my regular visitors may have noticed (or those who follow me via StatusNet), I've been working on redesigning my site. I've moved from a massive edit on the default Drupal 7 theme, Bartik + another theme for mobile to using an AdaptiveTheme sub theme. The beauty of the AdaptiveThemes is that it is a responsive design to start with therefore, you only really need one theme for all screen sizes. I've been having quite a bit of fun hacking away at the theme, adding some eye candy without letting the overall theme to become too overweight. Of course, this is usually the goal for most webdevs. One piece of eye candy that I really wanted was a full screen photo as the background. Of course, having a full resolution photo may not lead to a very lightweight design. Luckily, we have a fantastic command line tool that can help, ImageMagick. By using ImageMagick, I've managed to have (in my opinion at least) a quite nice looking background while keeping the overall page load size at 289.9kb. This page size…