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
location / { | |
# Rewrite rules and other criterias can go here | |
# Remember to avoid using if() where possible (http://wiki.nginx.org/IfIsEvil) | |
try_files $uri $uri/ @rewrites; | |
} | |
location @rewrites { | |
# Can put some of your own rewrite rules in here | |
# for example rewrite ^/~(.*)/(.*)/? /users/$1/$2 last; | |
rewrite ^/(.*)? /index.cfm/$1 last; |
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 output="false" { | |
public any function init(){ | |
variables.Stripe = createObject("Java", "com.stripe.Stripe"); | |
Stripe.apiKey = "<YOUR SECRET KEY HERE>"; | |
return this; | |
} | |
// https://github.com/jeisenlo/ColdFusion-Stripe-CFC | |
private numeric function timeToUTCInt(required timestamp date) { |
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
<cfoutput> | |
<cfscript> | |
Stripe = new data.Commerce.Stripe(); | |
card = { | |
"number": "4242424242424242", | |
"exp_month": "12", | |
"exp_year": "2015", | |
"cvc": "123", | |
"name": "Java Bindings Cardholder", | |
"address_line1": "140 2nd Street", |
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
<cfcomponent> | |
<cfscript> | |
variables.instance = structNew(); | |
instance.chatHistory = arrayNew(1); | |
instance.clients = arrayNew(1); | |
instance.messageTotal = arrayLen(instance.chatHistory); | |
</cfscript> | |
<cffunction name="init" access="public" returntype="chat"> | |
<cfreturn 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
component name="ChatService" accessors="false" scope="application" { | |
property name="Logger" inject="logbox:logger:{this}"; | |
property name="AntiSamy" inject="coldbox:plugin:AntiSamy"; | |
public ChatService function init(){ | |
variables.history = []; | |
variables.clients = []; | |
variables.messageCount = 0; // The ID of the last message | |
variables.birth = Now(); |
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 | |
accessors=false | |
extends="coldbox.system.EventHandler" | |
{ | |
property name="Logger" inject="logbox:logger:{this}"; | |
property name="ChatService" inject="model"; | |
// Posts a message to the stack | |
public void function put(Event, RC, PRC){ |
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){ |
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
/* | |
* 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
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"); |