Skip to content

Instantly share code, notes, and snippets.

<cfcomponent>
<cffunction name="getUserByUsername" access="public" returntype="query" output="false">
<cfargument name="username" type="string" required="true" />
<cfset var getUser = "" />
<cfquery name="getUser" datasource="blog-jason">
SELECT *
FROM USERS
WHERE username = <cfqueryparam value="#arguments.username#" cfsqltype="cf_sql_varchar" />
</cfquery>
@twelverobots
twelverobots / gist:4001416
Created November 2, 2012 13:38
Sieve of Eratosthenes - Jason
<!--- Create array of all numbers --->
<cfset aNumbers = [] />
<!--- Initialize Array with unmarked, except one --->
<cfset arraySet(aNumbers, 2, 1000, "unmarked") />
<cfset aNumbers[1] = "one" />
<!--- Loop over Array --->
<cfloop from="2" to="#arrayLen(aNumbers)#" index="numIndex">