Skip to content

Instantly share code, notes, and snippets.

View isummation's full-sized avatar

iSummation INC isummation

View GitHub Profile
/**
* @Author Parixit
* @Date 30 MAY 2016
* @use companyServiceTest
**/
/*
coldbox.system.testing.BaseModelTest need to extends for unit testing for below example.
<cfset x = 21945.16 />
<cfset y = 17256.13 />
<cfset z = x - y />
<cfoutput>#z#</cfoutput>
<cfset x = 21945.16 />
<cfset y = 17256.13 />
<cfset z = PrecisionEvaluate(x - y) />
<cfoutput>#z#</cfoutput>
select * from document
where documentid = <cfqueryparam value="#arguments.documentid#" cfsqltype="cf_sql_numeric">
select * from document
where documentid = <cfqueryparam value="#arguments.documentid#" cfsqltype="cf_sql_integer">
<!--- This will be you dbQuery for your export --->
<cfset qList = queryNew("c1,c2,c3") />
<cfloop from="1" to="10" index="i">
<cfset queryAddRow(qList, 1) />
<cfset querySetCell(qList, "C1", i) />
<cfset querySetCell(qList, "C2", "10/" &amp; i &amp; "/1985") />
<cfset querySetCell(qList, "C3", "Vikas" &amp; i) />
</cfloop>
@isummation
isummation / gas.js
Last active September 29, 2016 10:05
String.prototype.trimLeft = function(){ return this.replace(/^\s+/,'') }
String.prototype.trimRight = function(){ return this.replace(/\s+$/,'') }
String.prototype.trim = function(){ return this.trimLeft().trimRight() }
function readSheet(){
var dataFileId = ""; //TODO: add your data.txt file id
var ssFileId = ""; //TODO: add your spreadsheet file id
select * from document
where documentid = <cfqueryparam value="#arguments.documentid#" cfsqltype="cf_sql_numeric">
select * from document
where documentid = <cfqueryparam value="#arguments.documentid#" cfsqltype="cf_sql_integer">
@isummation
isummation / sql1.sql
Last active September 29, 2016 09:30
select *
from (
select NULL as FieldStatus
union all
select 1 as FieldStatus
union all
select 20 as FieldStatus
union all
select NULL as FieldStatus