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
function loadPage(hash, fn){ | |
if(!hash || hash == '') | |
return; // nothing to do | |
var url = (hash[0] == '#') ? hash.substring(2): hash; | |
$('#C').html('Loading Content...'); // replace with loading screen code | |
var callback = function(responseText, textStatus, XMLHttpRequest){ | |
$(document).attr('title', $(responseText).filter('title').text()); |
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
function loadPage(hash, fn){ | |
if(!hash || hash == ''){ | |
if(typeof _gaq !== 'undefined') | |
_gaq.push(['_trackPageview']); | |
return; // nothing to do | |
} | |
var url = (hash[0] == '#') ? hash.substring(2): hash; | |
$('#C').html('Loading Content...'); // replace with loading screen code |
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
// 404 Page | |
app.use(function(req, res, next){ | |
res.render('404.jade', {title: "404 - Page Not Found", showFullNav: false, status: 404, url: req.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
/** | |
* Modified from the Connect project: https://github.com/senchalabs/connect/blob/master/lib/middleware/errorHandler.js | |
* | |
* Flexible error handler, providing (_optional_) stack traces and logging | |
* and error message responses for requests accepting text, html, or json. | |
* | |
* Options: | |
* | |
* - `showStack` respond with both the error message and stack trace. Defaults to `false` | |
* - `showMessage`, respond with the exception message only. Defaults to `false` |
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 error = require('./lib/ErrorHandler'); | |
app.configure('development', function(){ | |
//app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); | |
app.use(error({ showMessage: true, dumpExceptions: true, showStack: true, logErrors: __dirname + '/log/error_log' })); | |
}); | |
app.configure('production', function(){ | |
//app.use(express.errorHandler()); | |
app.use(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
// Includes | |
var crypto = require('crypto'); | |
function hashString(value) { | |
hash = crypto.createHash('sha1'); | |
hash.update(value); | |
return hash.digest('hex'); | |
} | |
var AdminPages = module.exports = function AdminPages(){}; |
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') | |
, mongoStore = require('session-mongoose'); | |
var app = module.exports = express.createServer(); | |
// Configuration | |
app.configure(function(){ |
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 | |
class gPDO{ | |
public static function init(){ | |
$GLOBALS['gPDO'] = array(); | |
$GLOBALS['gPDO']['server'] = ''; | |
$GLOBALS['gPDO']['user'] = ''; | |
$GLOBALS['gPDO']['password'] = ''; | |
$GLOBALS['gPDO']['db'] = ''; | |
$GLOBALS['gPDO']['charset'] = 'UTF-8'; |
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
function project_add_user($var, $run = true){ | |
$expected = array('project_id' => '', 'id' => ''); | |
if(!cBasecamp::_checkVarTemplate($expected, $var, "project_del_user")) | |
return false; | |
if(!$run){ | |
cBasecamp::_schedule("project_add_user", "Add user to group", $var); | |
return true; | |
}elseif($run === true){ | |
// store then run with new taskid |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema | |
, ObjectId = Schema.ObjectId; | |
var Database = module.exports = function Database(){}; | |
Database.prototype = { | |
_collections: { | |
adminUser: { |