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
<cfscript> | |
table = "closure_test_table"; | |
dsn = "a-valid-dsn"; | |
try { | |
queryExecute(sql=" | |
CREATE TABLE #table# ( | |
[id] INT NOT NULL IDENTITY(1, 1), | |
[val] varchar(13) NOT NULL, |
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
<cfscript> | |
function boolean is_authorized(username, password) { | |
if(username == "admin" && password == "password"){ | |
return true; | |
} | |
else | |
return false; | |
} | |
function deleteRecord(id) { |
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
#!/usr/bin/lua | |
--[[ | |
Author: Don Quist | |
Date: 12/06/14 | |
https://www.sigmaprojects.org/ | |
https://gist.github.com/sigmaprojects | |
Simple Lua script to consume the conntrack table from luci and persist it in a MySQL database | |
--]] | |
function getDBConnection() |
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
<cfcomponent name="ImageManipulation" hint="Image manipulation functions." extends="coldbox.system.plugin" output="false" cache="false"> | |
<cfproperty name="imageObj" type="any" /> | |
<cfset variables.instance = StructNew() /> | |
<cffunction name="init" access="public" returntype="ImageManipulation" output="false"> | |
<cfargument name="controller" type="any" required="true"> | |
<cfset super.Init(arguments.controller) /> | |
<cfset setpluginName("ImageManipulation")> |
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
server { | |
listen 443; | |
server_name www.domain.com domain.com; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
ssl on; | |
ssl_certificate /path/to/.crt; | |
ssl_certificate_key /path/to/.key; |
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
component extends="coldbox.system.logging.AbstractAppender" output="false" | |
hint="This is a simple implementation of a appender that is BugLogHQ Plugin based" { | |
public BugLogHQAppender function init( | |
Required name, | |
properties = {}, | |
layout = "", | |
levelMin = 0, | |
levelMax = 4 |
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
<cfcomponent extends="model.loggers.appenders.BugLogHQAppender" | |
output="false" | |
hint="This is a simple implementation of a appender that is BugLogHQ based."> | |
<!--- Init ---> | |
<cffunction name="init" access="public" returntype="DBAppender" hint="Constructor" output="false" > | |
<!--- ************************************************************* ---> | |
<cfargument name="name" required="true" hint="The unique name for this appender."/> | |
<cfargument name="properties" required="false" default="#structnew()#" hint="A map of configuration properties for the appender"/> | |
<cfargument name="layout" required="false" default="" hint="The layout class to use in this appender for custom message rendering."/> |
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
<cfcomponent hint="Passes Exceptions and Bug Reports to BugLog" extends="coldbox.system.Plugin" output="false" cache="true" cachetimeout="0"> | |
<cffunction name="init" access="public" returntype="BugLog" output="false"> | |
<cfargument name="controller" type="any" required="true"> | |
<cfscript> | |
super.Init(arguments.controller); | |
setPluginName("BugLog"); | |
setPluginVersion("1.2"); | |
setPluginDescription("A Coldbox plugin to log errors using BugLog."); | |
setPluginAuthor("Donaldo DE SOUSA"); | |
setPluginAuthorURL("http://twitter.com/I_TwitIT"); |
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
private void function generateAllPossibleNonExistentRules() event=false { | |
var configStruct = getSettingsBean().getConfigStruct(); | |
var HandlersInvocationPath = configStruct.HandlersInvocationPath; | |
var RegisteredHandlers = configStruct.RegisteredHandlers; | |
var HandlerEvents = {}; | |
for(var i = 1; i<=ListLen(RegisteredHandlers);i++) { | |
var thisHandler = listGetAt(RegisteredHandlers,i); | |
var thisHandlerPath = HandlersInvocationPath & '.' & thisHandler; |
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
// Application.cfc | |
public boolean function onRequestStart(String targetPage){ | |
if(structKeyExists(url,"ormreload")) { | |
ORMReload(); | |
} | |
return true; | |
} |
NewerOlder