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="processColdBoxRequest" access="public" returntype="void" hint="Process a Coldbox Request" output="true" > | |
<cfset var cbController = 0> | |
<cfset var event = 0> | |
<cfset var exceptionService = 0> | |
<cfset var exceptionBean = 0> | |
<cfset var renderedContent = ""> | |
<cfset var eventCacheEntry = 0> | |
<cfset var interceptorData = structnew()> | |
<cfset var renderData = structnew()> | |
<cfset var refResults = structnew()> |
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
/** Ensure the proper environment regardless of domain used to construct the app **/ | |
component { | |
// PUBLIC METHODS --------------------------------------------------------------- | |
public void function configure(){ | |
// You don't have to put this in the application scope. | |
// I just like to keep it there. | |
application.machine | |
= createObject('java','java.net.InetAddress').getLocalHost().getHostName(); | |
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
<!--- getMockRequestContext ---> | |
<cffunction name="getMockRequestContext" output="false" access="private" returntype="coldbox.system.web.context.RequestContext" hint="Builds an empty functioning request context mocked with methods via MockBox. You can also optionally wipe all methods on it."> | |
<cfargument name="clearMethods" type="boolean" required="false" default="false" hint="Clear Methods on it?"/> | |
<cfargument name="classname" type="string" required="false" default="coldbox.system.web.context.RequestContext" hint="By default, the core ColdBox RequestContext will be created; however, a full classpath may be provided to allow you to use a decorated RequestContext object within your tests."/> | |
<cfscript> | |
var mockRC = ""; | |
var rcProps = structnew(); | |
if( arguments.clearMethods ){ | |
return getMockBox().createMock(className=arguments.classname,clearMethods=true); |
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
# Text Adventure Game | |
# "Inside the Matrix" | |
# http://aarongreenlee.com/ | |
SLEEPTIME = 1 | |
INTRO_STRINGS = ['The Matrix has you.','Follow the White Rabbit.'] | |
# Helpers | |
def print_delay(s) | |
sleep(SLEEPTIME) |
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
# Aaron Greenlee | |
# http://aarongreenlee.com/ | |
# Activity 2.1: Warmup 3 | |
puts "Give me three sets of words like 'apples and oranges' and 'are good to eat'" | |
puts "You'll then see every combination between the two groups." | |
word_groups = { :one => [],:two => [],:three => [] } | |
word_groups.each { |k,v| |
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
# Aaron Greenlee | |
# http://aarongreenlee.com/ | |
# Activity 2.1: Warmup 2 | |
array1 = [1, 2, 3, 4] | |
array2 = %w{peter piper picked peppers} | |
array3 = [] | |
array3 = array1.zip(array2).join(',').split(',') |
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
# Aaron Greenlee | |
# http://aarongreenlee.com/ | |
# Activity 2.1: Warmup 1 | |
MIN_N = 1 | |
MAX_N = 1000000 | |
STOP_GOING = ['no','n'] | |
KEEP_GOING = ['yes','y'] | |
GOOD_GOING_ANSWERS = KEEP_GOING | STOP_GOING | |
GOOD_GOING_ANSWERS_STRING = "'" + GOOD_GOING_ANSWERS.join('", "') + '"' |
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
# Aaron Greenlee (http://aarongreenlee.com) | |
# Learning Ruby exercise. It's fun. | |
MAX_NUMBER = 100 | |
MIN_NUMBER = 1 | |
ALLOWED_ATTEMPTS = 10 | |
MESSAGE_BREAK_POINT = ALLOWED_ATTEMPTS / 2 | |
CONTINUATION_INPUT_ANSWERS = ['yes','no','y','n','ok','sure','fo sizzle'] | |
QUIT_ANSWERS = ['n','no'] | |
CLUE_ANSWERS = ['clue'] |
NewerOlder