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
component { | |
property name = "SQSService" inject = "model"; | |
public function sendMessage(required string message) { | |
SQSService.sendMessage(queue = "test", message = arguments.message); | |
return; | |
} | |
public function startQueue() { | |
cfthread(name = "sqs-poll", action = "run", SQSService = SQSService) { |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<title>Simple Chat</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
</head> | |
<body> | |
<div id="messageContainer" style="display: none;"> |
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
component extends="coldbox.system.web.context.RequestContextDecorator" { | |
public void function configure(){ | |
var rc = getRequestContext().getCollection(); | |
var prc = getRequestContext().getCollection(private = true); | |
if(!structKeyExists(session, 'memberGUID')){ | |
session['memberGUID'] = getController().getSetting('defaultMemberGUID'); | |
} |
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
component name="WhosonTracker" { | |
function init(){ | |
variables.clients = []; | |
return this; | |
} | |
function trackHit(required Event){ | |
var updateFlag = 0; | |
var userCount = arrayLen(variables.clients); |
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
//Register interceptors as an array, we need order | |
interceptors = [ | |
//SES | |
{class="coldbox.system.interceptors.SES", | |
properties={} | |
} | |
//WhosOn | |
,{class="whoson.ColdBoxInterceptor", | |
properties={} | |
} |
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
component { | |
void function Configure() {} | |
boolean function afterAspectsLoad(required any event, required struct interceptData){ | |
var Tracker = new whoson.WhosonTracker(); | |
getColdboxOCM().set('WhosOn', Tracker, 0); | |
return 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
public function get(string objectid = '') { | |
var queryUser = new query(); | |
var hasParams = len(arguments.objectid) && isNumeric(arguments.objectid); | |
var sql = 'select objectID, username, password, bAdmin, ratingLimit from user'; | |
if(hasParams){ | |
sql = sql & ' where objectid = :objectid'; | |
} | |
queryUser.setSQL(sql); | |
if(hasParams){ | |
queryUser.addParam(name="objectid",value="1",cfsqltype="INT"); |
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
/* | |
* Interface with themoviedatabase.org | |
*/ | |
component name = "TMDBService" accessors = "false"{ | |
property name = "Logger" inject = "logbox:logger:{this}"; | |
property name = "api_key" inject = "coldbox:setting:apiKey"; | |
public TMDBService function init(){ | |
return this; |
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
server { | |
listen 80; | |
server_name domain.com; | |
rewrite ^(.*) https://$server_name$1 permanent; | |
} | |
server { | |
listen 443 ssl; | |
server_name domain.com; | |
client_max_body_size 50M; | |
access_log /var/logs/domain.com_access.log buffer=32k; |
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 engine = { | |
delay: 5000 | |
,currentID: 0 | |
,init: function(){ | |
window.chat = {}; | |
window.chat.data = {}; | |
$('#send').on('click', engine.sendMessage); | |
$('#setName').on('click', engine.setUser); | |
$('#message').on('keypress', function(e){ | |
if(e.which == 13 && $('#message').val().length){ |