Monthly Archives: October 2012

Encapsulation in Coffee Script

m.coffee ——— publicMethod1 = ->   @publicMember1 = "public member 1"   @publicMember2 = "public member 2"   console.log ‘publicMethod1***’   console.log ‘*’ + @publicMember1 publicMethod2 = ->   console.log ‘publicMethod2***’   @publicMethod1()   console.log ‘*’ + @publicMember2 class Foo … Continue reading

Posted in Node.js | Tagged | Comments Off on Encapsulation in Coffee Script

Write Module in Coffee Script for Node

There are a few ways to write a module in Coffee Script for Node. Below are two ways to contrast their usages. Notice how they share data @url and use function @find. 1. user.coffee ————- class User   constructor: (url) … Continue reading

Posted in Node.js | Tagged | Comments Off on Write Module in Coffee Script for Node

Even Amazon’s DPReview.com Has Limit:-)

Posted in General | Tagged , | Comments Off on Even Amazon’s DPReview.com Has Limit:-)

Reset CouchDB Instance

It’s really easy to clean up a CouchDB instance as fresh as new. Just delete the database files and .delete folder in /usr/local/var/lib/couchdb and restart the CouchDB service. $ sudo /etc/init.d/couchdb stop $ cd /usr/local/var/lib/couchdb $ sudo rm -rf * … Continue reading

Posted in NoSQL, Ubuntu | Tagged | Comments Off on Reset CouchDB Instance

Tunneling via Putty

When you use putty to log in CouchDB server, you can also set up tunneling to access its admin console restricted to localhost. Here’s the additional configurationĀ over your normal setup.

Posted in Ubuntu | Tagged , , | Comments Off on Tunneling via Putty

Running CouchDB Admin Console Remotely

CouchDB default configuration allows only localhost access to its admin console via Futon or curl. Without compromising server security and access, you can use ssh to tunnel to your CouchDB. Below is how to set up the tunnel. First, make … Continue reading

Posted in Ubuntu | Tagged | Comments Off on Running CouchDB Admin Console Remotely

Another vim resource site

vimninjas.com

Posted in General | Tagged | Comments Off on Another vim resource site

Vimcasts.org

For those who use vi or vim, here’s a nice site to watch useful tricks on using vim.

Posted in General | Tagged | Comments Off on Vimcasts.org

Mount Box.net to Ubuntu

I have this box.net account with 50GB free space unused. As Box supports DAV, we can mount it as backup storage. Below lists the commands to get you there. $ sudo apt-get install davfs2 #assume you don’t have davfs2 installed … Continue reading

Posted in Ubuntu | Tagged , | Comments Off on Mount Box.net to Ubuntu

Add Swap Space in Ubuntu

Many vendors provide no default swap partition in their images. If you use Ubuntu, here’s a quick way to add swap space, which is useful when you may run out of allocated physical memory. $ swapon -s $ sudo dd … Continue reading

Posted in Ubuntu | Tagged , | Comments Off on Add Swap Space in Ubuntu