Skip to content

Instantly share code, notes, and snippets.

View mikesprague's full-sized avatar

Michael Sprague mikesprague

  • Cornell University
  • New York
  • 03:07 (UTC -04:00)
View GitHub Profile
@mikesprague
mikesprague / gist:5706268
Last active December 25, 2015 11:47
JavaScript: getRootWebSitePath
function getRootWebSitePath() {
var _location = document.location.toString();
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var applicationName = _location.substring(0, applicationNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _
location.indexOf(applicationName) + applicationName.length);
var webFolderFullPath = _location.substring(0, webFolderIndex);
return webFolderFullPath;
}
@mikesprague
mikesprague / convert-query-to-struct-array.cfm
Last active December 25, 2015 11:49
CFML: convertQueryToStructArray
<cfscript>
function convertQueryToStructArray( q ) {
var result = [];
for ( var row in arguments.q ) {
result.append( row );
}
return result;
}