This file contains hidden or 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
# Helper class for sending emails. | |
# | |
# @author Ciaran Archer | |
class EmailHelper | |
# @author Ciaran Archer | |
# @param [String] to | |
# @param [String] subject | |
# @param [String] body | |
# @param [String] from |
This file contains hidden or 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
# Helper class for logging. | |
# This class will allow the user get a standard Ruby Logger instance. | |
# Any specific log file configuration (e.g. rollover size etc) | |
# should be done within this class. | |
# @todo - should we run all log() calls through this class? | |
# | |
# @author Ciaran Archer | |
class LoggerHelper | |
@log_dir = "./logs" |
This file contains hidden or 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
require 'rubygems' | |
require 'sinatra' | |
require 'active_record' | |
require 'logger' | |
class DatabaseSIA < ActiveRecord::Base | |
self.abstract_class = true | |
This file contains hidden or 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
<cfoutput> | |
<select name="birthMonth"> | |
<cfloop index="i" from="2010-01-01" to="2011-01-01" step="#createTimeSpan(31, 0, 0, 0)#"> | |
<option value="">#dateFormat(i, "MMM")#</option> | |
</cfloop> | |
This file contains hidden or 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="onMissingMethod" access="public" returntype="query" output="false" hint="Dynamic finder."> | |
<cfargument name="missingMethodName" type="string" required="true" /> | |
<cfargument name="missingMethodArguments" type="struct" required="true" /> | |
<cfset var searchFields = [] /> | |
<cfset var qRead = "" /> | |
<cfset var searchItem = "" /> | |
<cfset var i = 0 /> | |
<cfset var searchValue = "" /> | |
This file contains hidden or 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="getTicks" access="public" returntype="numeric" output="false" hint="Returns the number of .NET ticks representing a the given date."> | |
<cfargument name="dateValue" type="date" required="true" /> | |
<!--- | |
http://msdn.microsoft.com/en-us/library/system.datetime.ticks(v=vs.71).aspx | |
http://stackoverflow.com/questions/386341/c-how-do-i-convert-ticks-to-minutes | |
---> | |
<cfset var ticksAtEpochZero = 621355968000000000 /> <!--- Number of .NET ticks at Epoch time (January 1 1970 00:00) ---> | |
<cfset var ticksPerSec = 10000000 /> |
This file contains hidden or 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 output="false"> | |
<cfset this.name = "testApp" /> | |
<cfset this.clientManagement = false /> | |
<cfset this.sessionManagement = false /> | |
<cffunction name="onError" access="public" returntype="void" output="false" hint=""> | |
<cfargument name="err" type="any" required="true" /> | |
<cflog log="application" type="error" text="onError() called in '#this.name#' application: #ARGUMENTS.err.message#" /> |
NewerOlder