Web publishing

This is my portal page of web publishing, from codes to text and media. The topic has much overlap with web content management system (WCMS), which usually refers to blogs and wikipedia.


  • Github is the best place for general purpose. Besides repos, don’t forget to check Gist and Github pages.
  • jsFiddle and JS Bin: mainly for JavaScript-based Web Dev.
  • RPubs: particularly useful for host R code in R Markdown format (RMD file).


  • WordPress.com. WordPress.com provides hosting service, but you can also get the software from WordPress.org and find web hosts otherwhere, in which way, you may take better control of your blog sites with various plugins (e.g. code highlighter).
  • Blogger




Here is my portal page for CSS.


Twitter Bootstrap

  • I use Twitter Bootstrap, rather than write CSS from scratch and/or copy-n-paste CSS from different resources. It is very efficient web UI toolkit and provides more than CSS.
  • Customize themes. After a while, you may get tired of the default theme, you can customize themes at either the official website (not interactive) or interactive website like Bootstrap ThemeRoller. Or, you can simply well-designed themes from website like Bootswatch (free but few themes) and WrapBootstrap (paid but more themes).
  • CDN. BootstrapCDN provides CDN for Bootstrap and Bootswatch themes.
  • Alternatives. I haven’t used other alternatives (e.g. Flat UI Kit), since I don’t have a good reason to switch.

CSS preprocessors



  • Experiences with Bootstrap, Compass, Sass, and LESS (stack overflow post)


This is my portal page of Node.js.


  • The only problem for me is how to install it as users without root privilege. I found two articles are useful (here and here).


  • Node FAQ (understanding node.js)
  • project70: my favorite node tutorial





  • MySQL driver (discussion. Best-choice node-mysqlexample. Alternative, Sequenlize (doc and Github))
  • Derby.js: MVC designed to be used by Express.js as middleware (example)
  • Express.js: a web app framework uses middleware concept to enhance functionality of applications.
  • Connect.js: an extensible HTTP server framework for node, providing high performance “plugins” known as middleware. Connect is bundled with over 20 commonly used middleware, including a logger, session support, cookie parser and more.
  • nodemon: automatic re-running (or manually restart by type in rs)
  • mongodb: doc, driver API, BSON API, SQL to MongoDB
  • Grunt and plugins

Blogs & Articles

A Beginner’s Tutorial for Node.js

(first published at project70.com; modified by Mark.)

I’ve been spending some time learning Node.js.  Since there isn’t a clear definitive guide out there, I decided to put together a some of the best online resources I’ve found.

The goal of this tutorial is to bring a beginner fully up to speed with Node.  At the end you will understand Node’s eventing model and be able to create a site using the most popular modules and frameworks.  It should take about 4 to 5 hours total.

Prerequisites:  some knowledge of javascript in particular and web programming in general.


Node is a server-side javascript framework for building scalable web apps.  It’s relatively new but has gotten tons of attention and is definitely worth a look.  If you want to know more about why you should use Node, see this article from the Register.

Getting Started

I’ve found that the most important thing for understanding Node is to realize it initially places an additional burden on the programmer.  In traditional web frameworks such as Rails or Django, you typically write methods to handle incoming requests.  Your method can call directly to the database or file system because it runs on its own thread — it’s allowed to take as long as it wants to return a response. The server can always spin up other threads to handle other incoming requests.  This makes the logic straightforward — the entire handler can be written in one method.

In Node, the entire server has one single thread, so now your code must play nice.  If any of your handlers call a blocking method, the entire server is blocked.  Your code has to be constructed so that it always returns immediately and is called again when a response from the database or filesystem is ready.  The difference from before is that the handler logic is split.  Understanding this difference is the key to understanding Node.  I mention this here because initially most Node tutorials gloss over this point.  Just keep it in mind.  It will become more clear as you start learning.

The Basics (1 – 2 hours)

Start with ‘The Node Beginner Book’  by Manuel Kiessling.   For me it was the best overall getting-started guide to Node.js .  It can be read online for free (English version is incomplete when I visited the website).  Read the book and follow along with the examples.  It’s a short, easy to read book.  The last section, on handling file uploads, can be skipped.

By the end you’ll know how to set up a server on your machine, create a simple web server, use modules to organize code into files, create a simple routing system for requests, handle POST requests, and some existing libraries and tools.

Bonus reading:  Look at chapter 3 of ‘Up and Running with Node.js’ for a more in-depth discussion of the event loop and why blocking it is bad.

Going Deeper  (1 hour)

Now that you know the basics of Node it’s time to go a bit more in-depth.  We’ll start by taking a closer look at callbacks and control flow.  Read chapter 7 of ‘Mixu’s Node Book’.  Optional: continue to chapter 8 for a review of modules.

When you’re comfortable with control flow read chapters 910, and 11 to learn about the core API you’ll be using in all Node programs.  You can skim these a bit, since the book goes into detail, but just be aware of the APIs available so you know to look them up later.

One thing you’ll notice missing from Node are web framework niceties like a view / templating system.  Finding a Node web framework is the next step.

The Express Web Framework  (45 min)

Express is currently the de-facto web framework for Node.  Start by watching nodetuts.com‘s series of videos on Express: episode 910, and 11 (not available).  They’re about 15 minutes each and are a good intro to Express and the Jade templating language.

A Real Example (1 hour)

Time to look at a real example.  Read this blog post  and follow along.  It will show you how to create a simple blog site using Express as a web framework, Jade and Stylus for templating, and MongoDB for the backend.

Before you get started it might be helpful to take a quick tour of MongoDB.  It’s an interactive tutorial that takes only a few minutes to complete and helps provide context for the lesson.

Finishing up

Congrats!  You should now be able to create a ‘real’ database-backed web site using Node.  More importantly, you’ve learned enough to be able to continue learning on your own.

For this course I’ve tried to bring together the best content in order.  Any better resources out there that I forgot?  Please mention it in the comments!

List of resources mentioned in order

Other Resources

Chapters 5, 6, and 7 of Up and Running with Node.js have an overview of the Node.js core API.

Node Web Development is a decent overall introduction to Node.

The official Node documentation has a list of useful Node modules.

– See more at: http://project70.com/nodejs/beginners-tutorial-node-js/#sthash.oyJz1oAG.dpuf



Working with other database and frontend tools

  • A example with Express and MongoDB (part 2)
  • Example: blog rolling with mongoDB, express, and node
  • Example: create a RESTful API with mongoDB, express and node
  • Yeoman and Express.js (Herehere and here). No good solution so far (June 25th, 2013)

Under the hood



Finding a Perl Module Version

perl -MYourModule 999
perl -MYourModule -e 'print "$YourModule::VERSIONn"'

For example,

perl -MNet::SSLeay 999
perl -MNet::SSLeay -e 'print "$Net::SSLeay::VERSIONn"'


  • In first command, no space between and module name.
  • In second command, use $ before module name.