This file contains 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
app.use(function(request, response, next) { | |
var newHost = request.host.replace(/[http*:\\]*www./, ''); | |
if (request.host != newHost) { | |
// 301 is a "Moved Permanently" redirect. | |
res.redirect(301, request.protocol + "://" + newHost + request.url); | |
} else { | |
next(); | |
} | |
}); |
This file contains 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
// How to expose a global handler for my requestHandler to reach? | |
module.exports = handler = []; | |
exports.addToHandler = function(key, newFunction) { | |
handler[key] = newFunction; | |
} | |
// To handle things from my requestHandler, I'm thinking: | |
var handler = require('./taskHandler'); |
This file contains 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 nodemailer = require('nodemailer'); | |
exports.init = function (engineer, password) { | |
this.engineer = engineer; | |
this.password = password; | |
} | |
// Transport for tasks |
This file contains 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'), | |
processEmail = require('./processEmail'), | |
report = require('./report'), | |
api = require('express-api-helper'), | |
transport = require('./transport'); | |
// create a global queue that your whole server shares | |
var queue = async.queue(function(taskHandler, done) { | |
// you would just call some function on the taskHandler here that you pushed in |
This file contains 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
// I'm just being lazy and loading both apps here for simpliciy, | |
// but these would be started by themselves as their own | |
// servers somewhere else | |
// require('./this-app'); | |
// require('./that-app'); | |
// core node http lib for your proxy server | |
// you'd probably use the "https" module here, and add certs | |
// you could really use any http server for this, even express, but this | |
// is probably sufficient and simpler, since you won't be providing anything |
This file contains 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 Database { | |
private $host = "showcase.tdharris.net"; | |
private $user = "tdharris_admin"; | |
private $pass = "mylittlesecret"; | |
private $dbname = "tdharris_showcase"; | |
private $dbh; |
This file contains 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
// Create a lead record | |
leadData = new LeadData(true); | |
lead = new Lead(sm, leadData); | |
leadData.setPhone(client.getPhoneNumber()); | |
leadData.setMobilePhone(""); | |
lead.add(); | |
// Setup Agent 1 & dial client | |
c2c1 = new ClickToCall(sm); | |
c2c1 |
This file contains 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
package sf.test.telephony.us.transfers.warm; | |
import java.util.Collection; | |
import lmp.actions.CallPath; | |
import obj.CallPathData; | |
import obj.comms.nodes.NodeForward; | |
import obj.comms.nodes.NodeStart; | |
import org.json.JSONException; |
This file contains 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
package sf.test.telephony.us.transfers.warm; | |
import static org.junit.Assert.assertTrue; | |
import java.util.Collection; | |
import java.util.Set; | |
import obj.LeadData; | |
import org.echarts.test.sip.CATException; |
This file contains 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
package sf.test.telephony.us.transfers.warm; | |
import java.util.Collection; | |
import lmp.actions.CallPath; | |
import obj.CallPathData; | |
import obj.comms.nodes.NodeForward; | |
import obj.comms.nodes.NodeRepQueue; | |
import obj.comms.nodes.NodeStart; |
OlderNewer