Skip to content

Instantly share code, notes, and snippets.

View gratzc's full-sized avatar

Curt Gratz gratzc

View GitHub Profile
@gratzc
gratzc / gist:1975777
Created March 5, 2012 01:17
Add modules external location to CB
/**
* Fired when the module is registered and activated.
*/
function onLoad(){
//get the current external locations
var modulesExternalLocation = controller.getSetting('modulesExternalLocation');
//if the contentbox-modules isn't already part of the setting, add it and register/activate all modules
if (!arrayFind(modulesExternalLocation,"/contentbox-modules")) {
//get the module service
var ms = controller.getModuleService();
@gratzc
gratzc / gist:5999404
Last active December 19, 2015 18:29
MXUnit Decorator cfscript syntax
/**
* @mxunit:decorators mxunit.framework.decorators.TransactionRollbackDecorator
**/
component extends="coldbox.system.testing.BaseModelTest" model="model.SomeModel" {
void function setup() {
super.setup();
}
<cfif thisTag.executionMode is "start">
<cfsilent>
<!------------------------------------------------------------------------
Author : Curt Gratz
Date : 7/9/2010
Description :
Custom tag to render script sections of the jqGrid.
Needs to be inside
$(document).ready(function(){
)};
<!--- faqs event used to get Question/Answer sets for the grid in our Admin --->
<cffunction name="faqs" returntype="void" output="false" hint="I return the data struct of faqs for the grid">
<cfargument name="event" type="any" required="yes">
<cfargument name="rc" type="any" required="yes">
<cfargument name="prc" type="any" required="yes">
<cfscript>
var offset = ((rc.page-1)*rc.rows);
var sortOrder = rc.sidx & " " & rc.sord;
var qry = variables.FaqService.list(criteria={componentId=rc.componentID},offset=offset,max=rc.rows,sortOrder=sortOrder);
var count = variables.FaqService.count("componentID=#rc.componentID#");
CREATE TABLE #sp_who2
(
SPID INT,
Status VARCHAR(MAX),
LOGIN VARCHAR(MAX),
HostName VARCHAR(MAX),
BlkBy VARCHAR(MAX),
DBName VARCHAR(MAX),
Command VARCHAR(MAX),
CPUTime INT,
update offerBidderInfo
set bidCount = (select count(*) from ss_bids with (nolock) where offer_id = @offerID and retracted_by_buyer = 'N' and deleted = 'N'),
highBidAmount = b.highBid,
highBidID = b.id,
highBidderID = b.user_id,
proxyBidAmt = b.proxyBidAmount,
bidIncrementAmt = dbo.UDF_CALC_BID_INCREMENT_FROM_OFFERID(@offerID),
updateDate = getdate(),
commission_amt = dbo.udf_calc_commission(@offerID),
transaction_amt = dbo.udf_get_transaction_amount(@offerID, 'F'),
SELECT *
FROM `travel-sample`
WHERE type = ‘hotel’
ORDER BY country, city
OFFSET 0
LIMIT 10;
SELECT *
FROM `travel-sample`
WHERE type = ‘hotel’
ORDER BY country, city
OFFSET 10
LIMIT 10;
SELECT *
FROM `travel-sample`
WHERE type = ‘hotel’
ORDER BY country, city
OFFSET 1000000
LIMIT 10;
CREATE INDEX ixtypectcy ON `travel-sample` (type, country, city, META().id);