Skip to content

Instantly share code, notes, and snippets.

@roryl
roryl / IMyInterface.cfc
Last active March 13, 2016 05:34
Lucee Interfaces
interface {
public function myFunc(required string myString){
}
public function myOtherFunc(required array myArray){
}
@roryl
roryl / create_java.cfm
Last active June 6, 2016 12:55
Lucee - Integrating with native Java libraries
<cfscript>
javaArray = createObject("java", "java.util.ArrayList");
</cfscript>
@roryl
roryl / Application.cfc
Last active May 3, 2016 13:29
Lucee Dynamic Evaluation
component {
this.mappings["/temp"] = "ram://";
}
@roryl
roryl / array_literal.cfm
Last active April 11, 2016 12:29
Lucee Script Quick Reference
<cfscript>
myArray = ["value1", "value2"];
</cfscript>
@roryl
roryl / closing_tag_bodies.cfm
Last active June 6, 2016 12:56
Lucee Syntax overview
<cfsavecontent variable="myContent">
Output some text
</cfsavecontent>
@roryl
roryl / vagrantfile.rb
Created March 13, 2016 01:54
A sample vagrant file for building a CentOS 6.5 VM With Lucee, Apache and MySQL
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
<cfscript>
myVar = "test";
myStruct = {test:"foo"; test2:"bar"}
echo(myStruct[myVar]); //outputs "foo"
echo(myStruct["#test2#"]; //outputs "bar"
</cfscript>
@roryl
roryl / Application.cfc
Last active June 6, 2016 12:55
Local Scopes - Examples showing local scopes in functions
component {
}
@roryl
roryl / component_a.cfc
Last active February 9, 2020 16:16
First Class Functions - Examples of passing classes around
component {
public function init(){
return this;
}
public function otherFunc(){
echo("called!");
}
@roryl
roryl / component_implicit_path.cfc
Last active July 20, 2018 07:24
Lucee Book examples for creating components
component {
public function init(){
myObj = new components.subComponent();
}
}