Monthly Archives: September 2012

Function call in CoffeeScript

Here’s a little hassle in CoffeeScript syntax. Calling a function with parameter but without parentheses is fine. Below sample code works. express = require ‘express’ app = express() app.configure ->   app.use express.bodyParser()   app.use express.methodOverride()   app.use app.router app.get … Continue reading

Posted in Node.js | Tagged , | Comments Off on Function call in CoffeeScript

HTML5 and Facebook

Mark Zuckerberg said that Facebook wasted two years betting on HTML5 app instead of native app. My own experience in using Facebook on iPhone and Android does not really show major difference. HTML5 is looking better for many apps scenarios … Continue reading

Posted in General | Tagged , | Comments Off on HTML5 and Facebook

WebSocket with socket.io

Here’s a sample chat using socket.io. You can find the codes here. Live Demo. The style sheet is modified to work on iPhone, Android, Chrome, etc. The server echoes back all messages sent by each user in a browser. Socket.io … Continue reading

Posted in Node.js | Tagged , , , , | Comments Off on WebSocket with socket.io

Testing views in couchdb with curl

Couchdb has REST APIs and it works well with curl. Let’s build a contact database in Futon with following: Documents {"_id": "bill", "name": "bill", "groups": ["friends"], "type": "contact"} {"_id": "john", "name": "john", "groups": ["friends", "coworkers"], "type": "contact"} {"_id": "111-222-3333", "phone": … Continue reading

Posted in NoSQL | Tagged , , , , | Comments Off on Testing views in couchdb with curl