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
<cfscript> | |
loc.openBoxArr=[]; | |
loc.struct1= {sku:'123',name:'Test1'}; | |
loc.struct2= {sku:'456',name:'Test2'}; | |
arrayAppend(loc.openBoxArr, loc.struct1); | |
arrayAppend(loc.openBoxArr, loc.struct2); | |
loc.fileContents = ""; | |
for(line in loc.openBoxArr){ | |
loc.fileContents &= line.sku & "," & line.name & chr(13) & chr(10); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<cfscript> | |
testNumbers = [ | |
"0", "0.0", "0.00", "0.000", "0.001", | |
"0.1", "0.10", "0.100", "0.101", | |
"0.11", "0.110", "0.111" | |
]; | |
function formatter(n){ | |
n = int(n * 100) / 100; |
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> | |
<cffunction name="processFizz" access="remote" returntype="String"><!--- no output ---> | |
<cfargument name="input" type="numeric"><!--- no required ---> | |
<cfset var local = structNew()/> | |
<cfset local.result = ''/> | |
<cfif arguments.input MOD 3 EQ 0 AND arguments.input MOD 5 EQ 0> |
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
<!--- cf function that solves the fizzbuzz test ---> | |
<!--- I generally don't like functions outputing themselves, | |
I would rather have it do a return - gives you more flexability later ---> | |
<cffunction name="displayFBMsg" access="private" hint="whatever..."><!--- no returntype / no output ---> | |
<cfargument name="numberOfIterations" required="true" type="numeric"><!--- personal preference, I like name, type, required, but thats not a big deal ---> | |
<cfloop from="1" to="#arguments.numberOfIterations#" index="i"><!--- i is not var'd ---> | |
<!--- with this logic, you're going to do at least 2 checks on every number, | |
and if those pass, you'll do 4, regardless (just as a comparison) ---> | |
<cfif i MOD 3 EQ 0 OR i MOD 5 EQ 0> |
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="valueSearch2" returntype="string" access="remote"> | |
<cfargument name="input" type="numeric" required="true"/> | |
<cfset var local.msg = ''> | |
<cfset local.bitAR = arrayNew(1) /> | |
<cfset local.bitAR[1] = { bit = 256, name = 'Authority' } /> | |
<cfset local.bitAR[2] = { bit = 128, name = 'Claims' } /> | |
<cfset local.bitAR[3] = { bit = 64, name = 'Service Failure' } /> |