Skip to content

Instantly share code, notes, and snippets.

exports.handler = function(context, event, callback) {
const moment = require('moment-timezone');
// This represents current time
const now = moment().tz('America/Los_Angeles');
let isBizTime = false;
// Let's check if it's a weekday using moment().isoWeekday()
// Here monday = 1 and sunday = 7
@imthepitts
imthepitts / Application.cfc
Last active December 23, 2015 08:59
IIS URL Rewrite test case. web.config placed in web root, info.cfm placed in /asdf directory. Outbound rules disabled in URL Rewrite. Simple example of rewriting via CF in onRequestEnd.
<cfcomponent>
<cffunction name="onRequestEnd">
<!--- Get the generated output --->
<cfset var output = getPageContext().getCFOutput().getBuffer().toString()>
<!--- Apply outbound link rules --->
<cfset output = reReplace(output, '/info\.cfm\?subjectid=([^=&amp;]+)', '/info/\1', 'all')>
<!--- Clear the previous output and send the rewritten output in its place --->