Skip to content

Instantly share code, notes, and snippets.

@chippinkston
chippinkston / deORM
Last active May 23, 2017 19:41
Adam Tuttle's deORM
/*** Source: http://fusiongrokker.com/post/deorm ***/
public function deORM( obj = this, depth = 1, depthLimit = 10 ){
var deWormed = {};
if (depth >= depthLimit){
return {};
}
if (isSimpleValue( obj )){
deWormed = obj;
}
else if (isObject( obj )){
<h2>Longer first item</h2>
<div>
<div class="col-md-6" style="background-color: #ff8000">foo<br />foo<br />foo<br />foo<br />foo<br /></div>
<div class="col-md-6" style="background-color: #2b6e88">foo<br />foo<br />foo<br /></div>
<div class="col-md-6" style="background-color: #2b9933">foo<br />foo<br />foo<br />foo<br /></div>
</div>
<h2>Longer second item</h2>
<div>
<div class="col-md-6" style="background-color: #ff8000">foo<br />foo<br />foo<br /></div>
@chippinkston
chippinkston / index.cfm
Created March 9, 2017 19:13
testing lucee@4.5
<cfscript>
echo('testing');
test = new test();
dump(test.testMe());
dump(test.generics());
dump(test);
</cfscript>
@chippinkston
chippinkston / gist:bb26eaa78e969205d088f3905e7e4e43
Created February 17, 2017 17:04
vagrant cfconfig show settings
//install commandbox on the vagrant machine
CommandBox:lucee-server> cd /opt/lucee/lib/lucee-server/
CommandBox:lucee-server> cfconfig show from=. fromFormat=luceeServer@4.5
{
"searchResultsets":"yes",
"mergeURLAndForm":"no",
"requestTimeout":"0,0,0,50",
"clientCookies":"yes",
"scopeCascading":"standard",
@chippinkston
chippinkston / key [_FW1] doesn't exist - single line
Created October 12, 2016 15:33
Exception that keeps showing up in my logs.
"ERROR","http-nio-8888-exec-2","10/09/2016","21:45:00","","Message: key [_FW1] doesn't exist"
@chippinkston
chippinkston / key [MURA] doesn't exist
Created October 12, 2016 15:11
Exception that keeps showing up in my logs.
"ERROR","http-nio-8888-exec-22","10/08/2016","02:30:51","","key [MURA] doesn't exist
at lucee.runtime.type.util.StructSupport.invalidKey(StructSupport.java:66):66
at lucee.runtime.type.StructImpl.get(StructImpl.java:120):120
at user.sessionuserfacade_cfc$cf.udfCall1(/home/mysite/public_html/wwwroot/requirements/mura/user/sessionUserFacade.cfc:57):57
at user.sessionuserfacade_cfc$cf.udfCall(/home/mysite/public_html/wwwroot/requirements/mura/user/sessionUserFacade.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
@chippinkston
chippinkston / key [_FW1] doesn't exist
Created October 12, 2016 15:07
Exception that keeps showing up in my logs.
"ERROR","http-nio-8888-exec-8","10/07/2016","22:15:00","","key [_FW1] doesn't exist
at lucee.runtime.type.util.StructSupport.invalidKey(StructSupport.java:66):66
at lucee.runtime.type.scope.RequestImpl.get(RequestImpl.java:168):168
at lib.org.framework.one_cfc$cf.udfCalla(/home/mysite/public_html/lib/org/framework/one.cfc:2091):2091
at lib.org.framework.one_cfc$cf.udfCall(/home/mysite/public_html/lib/org/framework/one.cfc):-1
at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:766):766
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
@chippinkston
chippinkston / testDI-works.cfc
Last active April 28, 2016 17:38
Moving the declaration into the given() block works. Did direct call rather than using DI/1.
component extends="testbox.system.BaseSpec" accessors="true"{
function beforeAll(){
}
function run( testResults, testBox ){
feature( "Get a Count of Responses", function() {
describe("I want to know how many responses we have in the system"
, function() {
scenario( "Get all Response counts", function(){
given( "I have a Survey ID",function() {
variables.resultsService = new model.services.resultsService();
@chippinkston
chippinkston / testDI.cfc
Last active April 28, 2016 15:20
Example of unfound service - Throws Error: Component [test.model.testDI] has no accessible Member with name [RESULTSSERVICE]under Luccee 4.5.2.018 and TestBox v2.3.0+00044
component extends="testbox.system.BaseSpec" accessors="true"{
function beforeAll(){
variables.bf = new lib.org.framework.3_1_0.ioc("/model");
variables.bf.addBean("datasource", {"name"="myDSN"});
variables.resultsService = variables.bf.getBean('resultsService');
}
function run( testResults, testBox ){
feature( "Survey Reporting", function() {
describe("I want to know how many responses we have in the system"
, function() {
@chippinkston
chippinkston / GetTickets
Last active November 25, 2015 17:01
ORM In Query
tickets = ormExecuteQuery("
select
tic
from
tickets as tic
join
tic.status as status
where
status.name IN (:status)
"