Skip to content

Instantly share code, notes, and snippets.

@cybersonic
cybersonic / cfelse.cfm
Last active August 29, 2015 14:15
Demo code suggestion
<cfif false>
This will never run
<cfelse>
This will always run
</cfif>
or
<cfscript>
if(false){
<cfquery name = "getAgain" datasource="DSN">
select * from Table2 where ID in (<cfqueryparam cfsqltype="cf_sql_varchar" value="#ValueList(get.anotherID)#" list="true">)
</cfquery>
<Directory "/Users/markdrew/Sites">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
@cybersonic
cybersonic / gist:3904685
Created October 17, 2012 09:35
Anatomy of a Test Case
<cfcomponent extends="mxunit.framework.TestCase">
<!--- this will run before every single test in this test case --->
<cffunction name="setUp" returntype="void" access="public" hint="put things here that you want to run before each test">
<cfset obj = createObject("component","ObjectUnderTest")>
</cffunction>
<!--- this will run after every single test in this test case --->
import java.util.Observable;
public class MyDataStore extends Observable{
public void updateMeSomehow(){
setChanged();
notifyObservers();
}
}
public class RequestExectutionView extends ViewPart{
TreeViewer myTreeViewer;
...
public void createPartControl(Composite parent) {
Tree myTree = new Tree(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
myTree.setHeaderVisible(true);
myTreeViewer = new TreeViewer(executionTree);
myTreeViewer.setLabelProvider(new MyLabelProvider());
public void createPartControl(Composite parent) {
Tree myTree = new Tree(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
myTree.setHeaderVisible(true);
myTreeViewer = new TreeViewer(executionTree);
myTreeViewer.setLabelProvider(new MyLabelProvider());
myTreeViewer.setContentProvider(new ContentProvider());
myTreeViewer..setInput(MyDataStore.getInstance());
<!--- This file is part of Mura CMS.
Mura CMS is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, Version 2 of the License.
Mura CMS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
<cfscript>
nz = "Aotearoa";
arr = nz.toCharArray();
dump(arr);
</cfscript>
var beanFactory = new aop("/services");