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
/* | |
admin stuff | |
*/ | |
var app = module.parent.exports; | |
UserProvider = require('./favprovider-memory').UserProvider, | |
userProvider = new UserProvider(); | |
var sys = require('sys'); |
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
/* | |
admin stuff | |
*/ | |
var app = module.parent.exports; | |
UserProvider = require('./favprovider-memory').UserProvider, | |
userProvider = new UserProvider(); | |
var sys = require('sys'); |
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
/** | |
* Module dependencies. | |
*/ | |
console.log('getting setup'); | |
express = require('express'); | |
app = module.exports = express.createServer(); | |
var settings = require('./settings'), |
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
UrlProvider.prototype.update = function(url, callback) { | |
this.getCollection(function(error, urls_collection) { | |
if( error ) { | |
callback(error); | |
} else { | |
var oid = url["_id"]; | |
url.modified_on = new Date(); | |
console.log('updating ' + sys.inspect(url)); | |
faves_collection.save( url, function(error, url) { | |
console.log(sys.inspect(this.db.getLastErrorObj)); |
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
/** | |
update stats for the URL | |
*/ | |
hit_emitter.on('newHit', function(url, hit){ | |
var data = { "$push": { "stats.hits": hit }, "$inc": { "stats.hitcounter": 1 } } | |
urlProvider.update(url, data, function(error, url){ | |
console.log('updated hit: ' + JSON.stringify(url)); | |
}); | |
}); |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var app = module.exports = express.createServer(); | |
var EventEmitter = require('events').EventEmitter; | |
var app_emitter = new EventEmitter(); |
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
<mt:var name="override_identifier" value="1" /> <!-- to use the override template --> | |
<mt:var name="override_identifier" value="0" /> <!-- to not use the override template (or just don't include) --> |
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
<?php | |
$conn = mysql_connect('localhost', 'username', 'password'); | |
if(!$conn) { | |
echo 'Error: ' . mysql_errno() . ' - ' . mysql_error(); | |
} | |
?> | |
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
tables | |
-> ; | |
+-----------------------------+ | |
| Tables_in_ia2010 | | |
+-----------------------------+ | |
| access | | |
| actions | | |
| actions_aid | | |
| authmap | | |
| batch | |
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 net = require('net'); | |
var limestone = require('../limestone'); | |
exports.testConnection = function () { | |
// fire up listener | |
var finx = net.createServer(function(){ | |
console.log('got connection on port 9313') | |
}); | |
finx.listen(9313, function(){ | |
limestone.connect(9313, function(err) { |