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
<!--- | |
Method to convert query to csv | |
(sourced from http://www.bennadel.com/blog/1231-Converting-A-ColdFusion-Query-To-CSV-Using-QueryToCSV-.htm) | |
Change: argument "Fields" not mandatory, taking by default all of the columns in the query. | |
---> | |
<cffunction | |
name="QueryToCSV" | |
access="public" | |
returntype="string" | |
output="false" |
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
// transient bean | |
component accessors="true" { | |
// properties | |
property name="Code" type="string"; | |
// validation | |
this.constraints = { | |
}; |
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> | |
// Allow unique URL or combination of URLs, we recommend both enabled | |
setUniqueURLS(false); | |
// Auto reload configuration, true in dev makes sense to reload the routes on every request | |
//setAutoReload(false); | |
// Sets automatic route extension detection and places the extension in the rc.format variable | |
setExtensionDetection(true); | |
// The valid extensions this interceptor will detect | |
// setValidExtensions('xml,json,jsont,rss,html,htm'); | |
setValidExtensions('json'); |
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> | |
/** | |
* @hint Used for pagination, removes unwanted rows from a query. | |
* @qry The entire query object to be trimmed. | |
* @skip How many records to remove from the start. | |
* @take How many records to return after the @skip. -1 gets everything. | |
*/ | |
query function RemoveRows | |
( | |
required query qry, |
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> | |
/** | |
* @hint A simple interceptor that logs method calls and their results | |
*/ | |
component implements="coldbox.system.aop.MethodInterceptor" { | |
property name="log" inject="logbox:logger:{this}"; | |
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 { | |
void function onRequestCapture( any event, struct interceptData, any buffer ) { | |
if( listFindNoCase( "PUT,PATCH,DELETE", event.getHTTPMethod() ) ) { | |
// Content sent in from the client | |
var requestContent = toString( getHTTPRequestData().content ); | |
// If the package is JSON, then deserialize and add to the RC collection | |
if ( isJson(requestContent) ) { | |
var jsonRequestContent = deserializeJson( requestContent ); | |
var nullProperties = ""; |
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
<cffunction name="_createBatchFile" access="private" returntype="string" output="false"> | |
<cfset var LOCAL = structNew() /> | |
<cfset LOCAL.bFileExists = false /> | |
<cfset LOCAL.cAbsoluteFilePath = expandPath( "/print-zpl.bat" ) /> | |
<cfset LOCAL.cFileContents = "" /> | |
<cfif fileExists( LOCAL.cAbsoluteFilePath )> | |
<cfset LOCAL.bFileExists = true /> | |
</cfif> |
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 { | |
// Framework Services | |
property name="cbEntityService" inject="entityService"; | |
property name="cbValidator" inject="ValidationManager@cbvalidation"; | |
// Custom Services | |
property name="utils" inject="utils" persistent=false getter=false setter=false; |
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
# grant write permissions to the local user | |
sudo chgrp -R admin /usr/local | |
sudo chmod -R g+w /usr/local | |
# update brew | |
brew update | |
# upgrade CommandBox | |
brew upgrade commandbox |
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
public any function options( event, rc, prc ){ | |
var allowedVerbs = ""; | |
var currentEvent = event.getCurrentEvent(); | |
var sesInterceptor = getInterceptor( "SES" ); | |
var moduleName = event.getCurrentModule(); | |
var handler = currentEvent.listRest( ":" ).listDeleteAt( listFind( currentEvent, "options", "." ), "." ); | |
var currentRoute = event.getCurrentRoute(); | |
// list of routes in the SES Interceptor | |
var routes = sesInterceptor.getModuleRoutes( moduleName ); | |
arrayEach( |
OlderNewer