Author Archives: rp8

About rp8

Specialized in building sophisticated systems for trading & risks in commodity, exotics, commodity index & structured products. Specially interested in using open source stacks and cloud computing to build new generation of services and apps. Enjoy mountain biking & photography. github

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

TODO List with node.js, express, dust, backbone, iscroll & jquery mobile

Here’s a small project to play with a few modules in Node. Backbone provides a simple MVC and it’s possible to share the models and views in both client and server side. It can support one page web app with … Continue reading

Posted in Node.js | Tagged , , , , | Comments Off on TODO List with node.js, express, dust, backbone, iscroll & jquery mobile

Typo 6.1 Exporter for WordPress

I wrote two rake scripts to dump posts from Typo as planned in my last post. Here’re the steps. 1. Dump Typo’s posts into blog.xml $ cp words.rake export.rake /path/to/typo/lib/tasks/ $ cd /path/to/typo/ $ rake words[tags.rb] $ vi lib/tasks/tags.rb # … Continue reading

Posted in General | Tagged , , , | Comments Off on Typo 6.1 Exporter for WordPress

Migrating a blog from Typo 6 to WordPress 3.4 (imported)

Finally got time to switch our blog engine to much popular WordPress. There’s no existing tool that can convert a Typo blog to WordPress. Here’s my draft plan to do it myself. Write a sample post (this one) in WordPress. … Continue reading

Posted in General | Tagged , , , | 2 Comments

Migrating a blog from Typo 6 to WordPress 3.4

Finally got time to switch our blog engine to much popular WordPress. There’s no existing tool that can convert a Typo blog to WordPress. Here’s my draft plan to do it myself. Write a sample post (this one) in WordPress. … Continue reading

Posted in General | Tagged , , , | 2 Comments