A better way to link to code on Github:
- Highlight the code that you want to link to
- Then, tap the "y" key to jump to the last commit found for that region
- Copy the URL & paste wherever you want
<cfscript> | |
// drop this into your SITE or THEME eventHandler.cfc to trigger a 404 on missing .cfm files | |
public any function onSiteRequestStart($) { | |
request.uri = GetPageContext().GetRequest().GetRequestURI(); | |
request.template = Right(request.uri, 1) != '/' ? ListLast(request.uri, '/') : ''; | |
if ( Len(request.template) && !FileExists(ExpandPath(request.template)) ) { | |
request.currentfilenameadjusted = request.template; | |
} | |
} | |
</cfscript> |
<cfscript> | |
public any function getMyEvents(calendarid=variables.$.content('contentid'), months=6) { | |
var local = {}; | |
local.util = variables.$.getCalendarUtility(); | |
local.rsItems = local.util.getCalendarItems( | |
calendarid=arguments.calendarid | |
, start=Now() | |
, end=DateAdd('m', arguments.months, Now()) | |
); | |
return rsItems; |
A better way to link to code on Github:
<cfscript> | |
// Let's say you want to pass in some arguments to the file located under /includes/displayObjects.cfc. For example: | |
public any function dspMuraFW1App3($, someArg='', anotherArg='Something') { | |
param name='request.context' default='#{}#'; | |
StructAppend(request.context.myArgs, arguments); | |
// now they'll be available in your subapps as rc.myArgs.argName | |
return getApplication().doAction('app3:main.default'); | |
} | |
</cfscript> |
#! /bin/sh | |
# ================================================================== | |
# ______ __ _____ | |
# /_ __/___ ____ ___ _________ _/ /_ /__ / | |
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / / | |
# / / / /_/ / / / / / / /__/ /_/ / /_ / / | |
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/ | |
# Multi-instance Apache Tomcat installation with a focus | |
# on best-practices as defined by Apache, SpringSource, and MuleSoft |
<cfif Not StructKeyExists(server, 'railo')> | |
<cffunction name="esapiEncode" output="false" returntype="string"> | |
<cfargument name="encodeFor" type="string" default="html" hint="encode for what, valid values are: - css: for output inside Cascading Style Sheets (CSS) - dn: for output in LDAP Distinguished Names - html: for output inside HTML - html_attr: for output inside HTML Attributes - javascript: for output inside Javascript - ldap: for output in LDAP queries - url: for output in URL - vbscript: for output inside vbscript - xml: for output inside XML - xml_attr: for output inside XML Attributes - xpath: for output in XPath"> | |
<cfargument name="inputString" type="string" required="true" hint="Required. String to encode"> | |
<cfscript> | |
var lc = {}; | |
var encodedString = ''; | |
lc.encoder = CreateObject("java", "org.owasp.esapi.ESAPI").encoder(); | |
switch(arguments.encodeFor) { |
<cfscript> | |
// Drop this in your Site or Theme eventHandler.cfc | |
public string function onCalendarDefaultBodyRender(event, $) { | |
var str = ''; | |
savecontent variable='str' { | |
WriteOutput(arguments.$.dspInclude('display_objects/fullcalendar/index.cfm')); | |
} | |
return str; | |
} | |
<cfscript> | |
// Will NOT work unless you have 'allowlocalfiles=true' in /config/settings.ini.cfm | |
try { | |
filepath = ExpandPath('temp.pdf'); | |
} catch(any e) { | |
filepath = ''; | |
} | |
param name='form.thefile' default=filepath; |