Skip to content

Instantly share code, notes, and snippets.

View nastanford's full-sized avatar
🏠
Busy Coding

Nathan Stanford Sr nastanford

🏠
Busy Coding
  • Harrington, Delaware
View GitHub Profile
@nastanford
nastanford / CFFunctionAlternatingRow.cfm
Created September 4, 2012 11:52
ColdFusion - Function - Alternating Row Colors
<cfscript>
// Alternating Row (classes, bgcolor, or any other alternating row useage)
// example: alternatingRow(TheCurrentRowCount,EvenRowText,OddRowText)
function alternatingRow(currentRow,evenRow,oddRow) {
var returnVar = IIF(currentRow Mod 2, DE(evenrow), DE(oddrow));
return returnVar;
}
</cfscript>
@nastanford
nastanford / Windows7SendTo.txt
Created June 12, 2013 16:15
Find the Send To folder to add shortcuts.
Path in Explorer to SendTo:
%APPDATA%\Microsoft\Windows\SendTo
@nastanford
nastanford / OracleOwner_TableAndColumns.cfm
Created June 21, 2013 17:11
Oracle - List Tables and Columns for each table for an Owner
<basefont face="arial" />
<CFSET REQUEST.DSN = "yourdatasource" />
<CFSET REQUEST.OWNER = "owner" />
<CFQUERY NAME="tables" Datasource="#REQUEST.DSN#" >
SELECT table_name
FROM all_tables
WHERE owner = '#REQUEST.OWNER#'
ORDER BY TABLE_NAME
</CFQUERY>
@nastanford
nastanford / loopFormFields.cfm
Last active December 19, 2015 01:49
Loop through form fields
<cfloop index="thefield" list="#form.fieldnames#">
<cfset fields="#thefield# = #form[thefield]#">
<cfset fields="#thefield# = #evaluate(thefield)#">
<cfoutput>#fields#</cfoutput><br>
</cfloop>
Example making the form fields into hidden Form Fields
<!--- ********************************************** --->
<cfloop index="thefield" list="#form.fieldnames#">
<input type="hidden" name="#thefield#" value="#form[thefield]#" />
@nastanford
nastanford / showHide.html
Last active December 6, 2019 04:24
JavaScript Show Hide Scripts Samples
<script type="text/javascript">
<!--
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
@nastanford
nastanford / callDuplicates.sql
Created June 28, 2013 18:17
query an oracle to get duplicates.
select column_name, count(column_name)
from table
group by column_name
having count (column_name) > 1;
@nastanford
nastanford / queryToArrayOfStructures.cfm
Created August 21, 2013 13:17
Query to array of Structures
<cffunction name="querytoarray" returntype="array" output="No">
<cfargument name="q" required="Yes" type="query">
<cfset var aTmp = arraynew(1)>
<cfif q.recordcount>
<cfloop query="q">
<cfset stTmp = structNew()>
<cfloop list="#lcase(q.columnlist)#" index="col">
<cfset stTmp[col] = q[col][currentRow]>
</cfloop>
@nastanford
nastanford / getSelectedText.js
Last active June 8, 2020 11:34
Using JavaScript get the Text or Value of a Selected Item in a Select Box.
function getSelectedText(){
var e = document.getElementById("nameSelect");
var dspText = e.options[e.selectedIndex].text;
return dspText;
}
@nastanford
nastanford / ColdBox_htmlBaseURL.cfm
Created December 2, 2013 20:13
ColdBox HTML Base URL for style sheets and JavaScript.
<base href="#getSetting('htmlbaseURL')#"/>
<link href="#getSetting('htmlbaseURL')#includes/styles/default.css" rel="stylesheet">
@nastanford
nastanford / Coldbox.cfc
Created January 25, 2014 16:13
CFArtGalleryCB - Coldbox.cfc file.
<cfcomponent output="false" hint="My App Configuration">
<cfscript>
/**
structures/arrays to create for configuration
- coldbox (struct)
- settings (struct)
- conventions (struct)
- environments (struct)
- ioc (struct)