This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
add = function( x, y ) { return x + y; }; | |
</cfscript> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component name="Actor REST Endpoint" accessors="true" output="false" { | |
// FW/1 will use its dependency injection framework (DI/1) to find and | |
// inject the components defined below as properties | |
property fw; | |
property actorService; | |
property movieToActorService; | |
public void function default( rc ){ | |
var q = actorService.getAll(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component { | |
function init(required query data){ | |
setQuery(arguments.data); | |
return this; | |
} | |
/* ---------------------------- PUBLIC ---------------------------- */ | |
/* --- Iterator methods ---------------------------- */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component displayname="GIS Plant Asset Service" extends="app.model.services.baseService" accessors="true" { | |
property assetGateway; | |
public array function list() { | |
return populateBeans( "assetBean", assetGateway.select() ); | |
} | |
public array function getByAssetID ( required string assetid ) { | |
var data = assetGateway.select( { assetid : assetid } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Configure multiple shells | |
"shellLauncher.shells.windows": [ | |
{ | |
"shell": "C:\\Windows\\System32\\cmd.exe", | |
"args": [ | |
"" | |
], | |
"label": "cmd shell" | |
}, | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component displayname="Base Service" accessors="true" output="false" { | |
property beanFactory; | |
public function init() { | |
return this; | |
} | |
private function populate ( any bean, struct properties, any beanFactory ) { | |
writeLog( text="#GetMetaData( this ).name#-->#getFunctionCalledName()#() arguments: #SerializeJSON( arguments )#", file="GISReports.local.dev", type="information" ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Using closures, it is possible to create an "object-like" struct with cfml and not using any components. It allows you to do encapsulation, have methods, do chaining, etc. It's api is pretty much identical to an object, except that you use a function to create it (instead of new). ACF10+ and Lucee 4.5+</p> | |
<cfscript> | |
function make (required numeric input) { | |
var value = input; | |
var o = { | |
add: function (required numeric input) { | |
value += input; | |
return o; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"scripts":{ | |
"postVersion":"package set location='user/repo#v`package version`'", | |
"onRelease":"publish", | |
"postPublish":"!git push && !git push --tags" | |
}, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myNumber = 10; | |
writeOutput( myNumber.len() ); | |
//This will throw a "The len method was not found" | |
myJavaNumber = JavaCast( "int", myNumber ); | |
writeOutput( myJavaNumber.len() ); | |
//This will throw a "The len method was not found" | |
myQueryNumber = queryNew( "id", "integer", {id: 16} ).id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @mxunit:decorators mxunit.framework.decorators.OrderedTestDecorator | |
*/ | |
component extends="Koans.BaseKoan" { | |
public void function beforeTests() { | |
variables.person = createObject( 'component','components.Person' ).init( 'Malcolm','Reynolds',CreateDate(2486,9,20)); | |
} | |
public void function testSaveAsMock() { |
NewerOlder