Quick NodeJS Http Server

If you are working on a simple web page or web app you may want to serve your assets through an http server but you don’t want to install such big solutions like MAMP or similar stuff.

http-server is a NodeJS command line utility which just allow you to start a zero config http server on a filesystem folder.

You may install it as a global module:

sudo npm install -g http-server

Then you can move to your working folder and launch:

http-server

Or you can specify the working folder as param:

http-server ~/MyWorkingFolder

Your files will be available at:

http://localhost:8080

Truly amazing, quick and simple!

fix grunt-browserify 2.0.1

The new 2.0.1 version of grunt-browserify task breaks the support for generating bundle’s source maps:
(see reported issue #162)

browserify: {
  target: {
    options: {
      debug: true // does not work anymore!
    }
  }
}

I proposed a pull request to fix the problem but until they evaluate and merge it you can fix the problem by yourself by using this forked repo which contains the fix or you can just edit a package source file:

// file: grunt-browserify/lib/runner.js
// place following code after line #158:
if (opts.debug) {
  opts.bundleOptions.debug = true;
}

That’s it!

Update: new config explained!

We are now talking about this PR on GitHub and – thanks to @RoboTeddy – I can gives you the new configuration for the debug option:

browserify: {
  target: {
    options: {
      bundleOptions : {
        debug: true
      }
    }
  }
}

This works and there should be another new options.browserifyOptions which I didn’t investigate yet.

These are supposed to grant forward compatibility to support new browserify options.

I like this approach but totally disagree with the version number they used to introduce this new configuration. They used a bug fix release number (2.0.1) which should do not break backward compatibility.

NoBlackMagic Theme

A few days ago I start working on a new Responsive Theme for building a blog or a website named NoBlackMagic.

It still in a deep proof-of-concept status but I’d like to list some characteristics of which I’m proud:

  • dropdown menu on smartphones
  • floating sidebar with touch swipe gestoures on tablet
  • fixed sidebar on desktop
  • highly configurable LESS sources
  • less than 1Kb Javascript (no jQuery dependencies)
  • GruntJS tasks for development and deploy

Fork on GitHub!

jQbrick’s SQLite Library

Today I start writing a SQLite Abstraction Layer to be distributed within jQbrick project.

I will provide some plain API to perform queries, query chains and – generally – multiple asynchronous operations with easy flow control.
To fulfill this objective I will use async.js library as dependency of SQLite package.

Another task on my list is to provide methods to manage tables easily, to handle versioning of the database and to synchronize database structure with a declarative JSON source.

You can follow my job here:
https://github.com/movableapp/jQbrick/tree/master/js/Lib/sqlite

We use web standards to build multi platform mobile apps!