This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var async = require('async'); | |
var pg = require('pg'); | |
var connString = "postgres://postgres@localhost/template1"; | |
// attempt 1 - all ok | |
pg.connect(connString, function(err, client, done) { | |
// this function has a .length of 3 ... therefore done is defined | |
console.log('1) Connected ok'); | |
done(); | |
// pg.end(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
+ \brief readUsers | |
+ | |
+ This function will return all user objects to the client | |
+ | |
+ \author Salvatore D'Agostino | |
+ \date 2012-11-05 20:47 | |
+ \param response The response to return to the client | |
+ \param client (PSQL) PSQL client object | |
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
"use strict"; | |
var fs = require('fs'); | |
var net = require('net'); | |
var uuid = require('node-uuid'); | |
var async = require('async'); | |
var cobol = require('../lib/cobol'); | |
var fifo = require('../lib/fifo'); | |
var tmpuuid = '/tmp/' + uuid.v4(), cust = 'upgrade', user = 'WEB99'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require("util"); | |
//// Model //// | |
var Model = function(data) { | |
this._data = data | |
} | |
Model.prototype.show = function (data, cb) { | |
// act on data and then return exicute the callback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TinyOOP = { | |
mixin: function(target, other) { for(var key in other) { target[key] = other[key] }; return target }, | |
class: function(parent, definition) { | |
var klass = parent.subclass(definition); | |
}, | |
ClassMethods: { | |
subclass: function(definition) { | |
return TinyOOP.Class(this, definition); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pg = require('pg'); | |
var cs = "postgres://blarg:blarg@localhost/blarg-upload-development"; | |
pg.connect( cs, function( err, client ) { | |
//check for a connection error | |
if(err) { | |
console.log(err); | |
return; | |
} | |
var filename = "foobar"; |