David Herron is a blogger, software engineer, electric vehicle enthusiast, and energy healer.

Distributing, publicly or privately, Node.js modules without using npm repository

The default assumption for distributing a Node.js module is to publish it in the public npm registry. It's a simple declaration in the package.json, and then you tell your customers to simply type "npm install". The public npm registry takes care of the details, and you can even use versioning to make sure your customers use tested module versions. But what if you don't want to publish modules in the public npm registry?

How do you choose between Node.js or other web application technologies?

There are plenty of new server side web application development technologies being developed. With the blizzard of choices before us, how do you choose between one or another? Will the newly hot web app technology really take off, or will it fizzle in a few years? For example, Node.js is getting a lot of excitement, but what about Go, or what about the mature platforms like PHP/Symfony or CakePHP?

Here's some ideas of how to choose a platform or technology.

Into the Evil of the Daleks - S08E02 and OldWho #038

We just watched Into the Dalek, and we have to acknowledge something - the story line references way back into Old Who, to a set of Patrick Troughton (Doctor #2) episodes collectively titled The Evil of the Daleks. In both cases we had a humanizing of Daleks, and Doctor#12's certainty there can be no humanizing of Daleks may stem from the experiences shown in The Evil of the Daleks.

Take a deep breath, don't hold it, we're going into the Dalek (Dr Who S08 E01 E02 review)

Doctor Who is finally back on our screens, and I'm going to squeeze my episode reviews together. It's a bang-up opening for Peter Capaldi as Doctor #12 (or is it #14), so it sure looks like this new guy will do well with the role. As for the content - the main theme so far is "identity". Who am I? Why do I choose this face to show the world? That sort of thing. And then there's the question of "who the heck is Missy"? Heaven? Surely that's a setup for the end of the season, so we'll have to be patient about that.

You can joyfully parse and manipulate URL's in browser-based JavaScript

URL's are not strings, but are a data structure that's represented as a string. How do you easily and reliably manipulate a URL string programmatically? Do you use regular expressions or other kinds of string manipulations? Given all the ways to encode data in a URL, how do you ensure it remains syntactically correct while doing string manipulation? Manipulating URL's with regular expressions is rather difficult because of the format and nature of a URL.

Silicon Valley housing costs are insane, verified by real data

Housing costs in Silicon Valley are insane. Both rental and purchased housing has always have been outrageous, compared to the rest of the country, but the last two years has seen an absolutely insane rise in property values and rental rates. I haven't looked for data on this, but obviously those at the lower end of the pay scale are being priced out of the market.

Fixing broken images when Drupal adds _0 to uploaded file names; filename and filepath differs

druplicon.large_.pngOccasionally on Drupal sites (perhaps only Drupal 6), uploading a file to a file field, or the file uploads area on a node, results in the "filepath" indicating a different name than the "filename". That is, in the data model for a Node, you can attach files in the "uploads" or in a CCK field (in Drupal 7 this is slightly different) and each attached file is an object (or array) containing attributes named "filename" and "filepath".

Easily offload your CPU-intensive Node.js code with simple Express-based REST server

nodejs-dark.pngNode.js is horrible with CPU bound processing, supposedly. Why? Because CPU-intensive algorithms block the event loop from handling events, blocking the Node.js platform from doing its core competency. Actually, as I demonstrate in my book Node Web Development (see sidebar for link), it's possible to use "setImmediate" to dispatch work through the Node.js event loop, and perform intensive computation while not blocking the event loop.

Unit testing Express route handlers in isolation from everything, including Express

nodejs-dark.pngWhen we write unit tests it's good practice to "mock" out extraneous bits to the code being tested. It's almost like the scientific method in that testing, in the unit testing paradigm, means exercising each small portion of your code in isolation if only to eliminate unwanted variables. While there are other testing paradigms, unit testing has its value. A big question for Node.js web application programmers is - how do you mock out HTTP requests for unit testing?

Progress on jQuery-style templates for AkashaCMS (Mahabhuta)

Since last weekend I've been working on Mahabhuta, the new element-oriented template system using jQuery's API, in AkashaCMS. The goal was to verify that it's useful by attempting to implement some important things with it. I'm happy to say that Mahabhuta is living up to what I hoped. I've been able to reduce complexity in AkashaCMS and the path is clear to perhaps removing the Kernel template engine, because the functionality I sought with Kernel is now available via Mahabhuta.

Pages

Short URL

Subscribe to Front page feed