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
function objectifyForm(formArray) { //serializeArray data function | |
var returnArray = {}; | |
for (var i = 0; i < formArray.length; i++){ | |
returnArray[formArray[i]['name']] = ((formArray[i]['name'] in returnArray) ? returnArray[formArray[i]['name']] + ',' + formArray[i]['value'] : formArray[i]['value']); | |
} | |
return returnArray; | |
} |
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
/* | |
Phaser 3 utility functions | |
Author: Gary Stanton | |
*/ | |
/** | |
* Get GID from a tileset by property and value | |
* @param {Phaser.Tilemaps.Tileset} tileset - A Phaser Tileset object | |
* @param {string} name - The name of the property to inspect |
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="S3_PutObject" access="public" returntype="struct"> | |
<cfargument name="Bucket" type="string" required="true" hint="The name of the bucket to which you would like to upload the file" /> | |
<cfargument name="FilePath" type="string" required="true" hint="Full path of the file you would like to upload" /> | |
<cfargument name="BucketPath" type="string" required="true" hint="Path within your bucket, to which you would like this file to be added" /> | |
<cfargument name="AccessControl" type="string" default="Private" hint="Access level to grant to this file (Private / PublicRead)" /> | |
<cfscript> | |
try { | |
// Check file exists | |
if (NOT fileExists(Arguments.FilePath)) { |
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
<!--- | |
Calculate arrival date for a package, taking into account working days and public holidays | |
---> | |
<cffunction name="calculateArrivalDate" access="public" returnType="struct" output="false" hint="Returns information about the arrival of a shipment based on a shipping date and shipping length"> | |
<cfargument name="OrderDate" type="date" default="#Now()#" hint="Date shipment is hoped to take place - i.e. the date an order is made" /> | |
<cfargument name="cutOffTime" type="string" default="#CreateTime(15, 0, 0)#" hint="Cut off time for a shipment to occurr on the same day" /> | |
<cfargument name="businessDays" type="string" default="2,3,4,5,6" hint="Days of the week (1 = Sunday) that may be considered a business day in this context" /> | |
<cfargument name="arrivalDays" type="string" default="2,3,4,5,6" hint="Days of the week (1 = Sunday) that a package may be delivered in this context" /> | |
<cfargument name="shippingLength" type="string" default="2" hint="Amount of time in days, expected fo |
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="closestNumberInList" returntype="numeric" hint="Returns the closest number in a list to the given value"> | |
<cfargument name="Value" type="numeric" required="true" hint="A number to convert to the nearest in our list"> | |
<cfargument name="List" type="string" required="true" hint="A list of valid numbers we can return"> | |
<cfscript> | |
var Local = {}; | |
// Convert list to array | |
Local.ListArray = ListToArray(Arguments.List); |