Skip to content

Instantly share code, notes, and snippets.

View samal's full-sized avatar

Samal Gorai samal

View GitHub Profile
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},
@samal
samal / cache_conn.js
Created March 28, 2012 05:23
caching a connection
Pool.prototype.connect = function(callback){
var i = 0, finished = 0, client, self = this, len = this.hosts.length,
connected = 0;
/*
Check if connection is cached. Yes use it. Otherwise create it and cache it in `self.ks`.
`0` only tested with single server. Need to do it for pool of server.
*/
if(this.clients[0]&& this.clients[0].ready){