Skip to content

Instantly share code, notes, and snippets.

'use strict';
describe('Controller: TodoListController handles Todo Lists', function () {
// load the controller's module
beforeEach(module('todosApp'));
var todoListCtrl,
scope;
<cfcomponent>
<cffunction name="getData" access="public" returntype="any" output="false">
<!--- Get the feed --->
<cfset var feed = application.feedManager.readByName("Programs", "DCTC") />
<!--- Set the feed to include enough records that it won't get cut off --->
<cfset feed.setNextN(100) />
<cfset feed.setMaxItems(100) />
<!--- Grab the query from the feed, I also could have done this with the iterator, but it is easier to look at the data this way --->
<cfset feed = application.feedManager.readByName("Programs", "DCTC") />
<cfset feed.setNextN(100) />
<cfset feed.setMaxItems(100) />
<cfset qFeed = feed.getQuery() />
<cfset dataorder = [] />
<cfset datarecords = {} />
<cfset dataset = {} />
/assets/
/cache/
.LCK
.lck
.settings
.project
settings.xml
.rds*
.svn
_mm*
<cffunction name="onCFCRequest" access="public" returntype="any" output="false">
<cfargument name="cfcname" type="string" />
<cfargument name="method" type="string" />
<cfargument name="args" type="struct" />
<cfset var result = "" />
<cftry>
<cfinvoke component="#arguments.cfcname#" method="#arguments.method#" argumentCollection="#arguments.args#" returnvariable="result" />
<cfcomponent>
<cffunction name="onCFCRequest" access="public" returntype="any" output="false">
<cfargument name="cfcname" type="string" />
<cfargument name="method" type="string" />
<cfargument name="args" type="struct" />
<cfset var result = "" />
<cfif structKeyExists(URL, "returnFormat") AND NOT listFindNoCase("json,wddx,plain,xml", URL.returnFormat)>
<cfcomponent>
<cffunction name="onCFCRequest" access="public" returntype="any" output="false">
<cfargument name="cfcname" type="string" />
<cfargument name="method" type="string" />
<cfargument name="args" type="struct" />
<cfset var result = "" />
<cfxml variable="myXML">
<?xml version="1.0" encoding="UTF-8"?>
<data>
<users>
<user>
<name>Bill</name>
</user>
<user>
<name>Dave</name>
</user>
@twelverobots
twelverobots / Logger.cfc
Created April 14, 2014 15:58
A Simple ColdFusion Logger object
/**
* Created by jason on 3/20/14.
*/
component accessors="true" {
property defaultLogLevel;
property applicationName;
public void function debug(String message, String extraInfo) {
@twelverobots
twelverobots / bytes.cfm
Created April 14, 2014 19:05
Breaking up a byte array into smaller chunks in ColdFusion using Java
<cfset text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum." />
<!--- Get the byteArray of the text to be handled --->
<cfset byteArray = text.getBytes() />
<!--- An array to store the broken up chunks --->
<cfset bytes = [] />
<!--- THe java array utility --->
<cfset javaArray = createObject("java", "java.util.Arrays") />