Skip to content

Instantly share code, notes, and snippets.

View neokoenig's full-sized avatar

Tom King neokoenig

View GitHub Profile
_____ _ ____
/ ____| | | _ \
| | ___ _ __ ___ _ __ ___ __ _ _ __ __| | |_) | _____ __
| | / _ \| '_ ` _ \| '_ ` _ \ / _` | '_ \ / _` | _ < / _ \ \/ /
| |___| (_) | | | | | | | | | | | (_| | | | | (_| | |_) | (_) > <
\_____\___/|_| |_| |_|_| |_| |_|\__,_|_| |_|\__,_|____/ \___/_/\_\ v3.2.0+00397
Welcome to CommandBox!
Type "help" for help, or "help [command]" to be more specific.
CommandBox:test> wheels info
/**
* Info
**/
component extends="base" {
/**
*
**/
function run( ) {
var current={
<cfscript>
yourEmail="test@domain.com";
cfdocument(format='pdf', name="test1", fontembed="true"){
writeOutput("TEST");
};
fileWrite("ram://Sample.pdf", test1);
if(fileExists("ram://Sample.pdf")){
@neokoenig
neokoenig / urlrewrite.xml
Created September 8, 2015 12:38
Tuckey URL rewrite rules for cfwheels 1.4.2
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 4.0//EN"
"http://www.tuckey.org/res/dtds/urlrewrite4.0.dtd">
<urlrewrite>
<rule>
<name>Index.cfm Hack</name>
<note>
We need to alias index.cfm -> rewrite.cfm
</note>
Hits /Application.cfc;
- /wheels/functions.cfm
- /config/app.cfm
- /wheels/controller/appfunctions.cfm
- /wheels/controller/caching.cfm
- /wheels/controller/filters.cfm
- /wheels/controller/flash.cfm
- /wheels/controller/initialization.cfm
- /wheels/controller/miscellaneous.cfm
- /wheels/controller/redirection.cfm
Lucee 5.0.0.49 Error (expression)
Message The key [WHEELS] does not exist, only the following keys are available: [applicationname].
Stacktrace The Error Occurred in
C:\Users\Tom\Downloads\lucee-5.0.0.49-express1\webapps\ROOT\wheels\index.cfm: line 1
1: <cfoutput>#application.wheels.dispatch.$request()#</cfoutput>
called from C:\Users\Tom\Downloads\lucee-5.0.0.49-express1\webapps\ROOT\index.cfm: line 2
Java Stacktrace lucee.runtime.exp.ExpressionException: The key [WHEELS] does not exist, only the following keys are available: [applicationname].
at lucee.runtime.type.util.StructSupport.invalidKey(StructSupport.java:64)
at lucee.runtime.type.StructImpl.get(StructImpl.java:121)
@neokoenig
neokoenig / gist:1614b229cdbbba5799d4
Created June 3, 2015 10:14
Gridmanager Specific Non Editable Columns
<div id="mycanvas" class="clearfix">
<div class="row"><div class="column col-md-6 col-sm-6 col-xs-6"><!--gm-editable-region--><p>New Content</p><!--/gm-editable-region--></div><div class="column col-md-6 col-sm-6 col-xs-6 noteditable"><!--gm-editable-region--><p>Not Editable</p><!--/gm-editable-region--></div></div>
<div class="row"><div class="column col-md-6 col-sm-6 col-xs-6 noteditable"><!--gm-editable-region--><p>Not Editable</p><!--/gm-editable-region--></div><div class="column col-md-6 col-sm-6 col-xs-6 "><!--gm-editable-region--><p>New Content</p><!--/gm-editable-region--></div></div>
</div>
<!--================== JS ================-->
<script>
$(document).ready(function(){
public function updatesortorder(){
if(isAjax()){
params.neworder=replace(params.neworder, "[", "all");
params.neworder=replace(params.neworder, "]", "all");
if(structKeyExists(params, "menuid") AND structKeyExists(params, "neworder")){
for (i=1;i<=listlen(params.neworder);i++) {
item=model("menuitem").updateOne(where="id=#listGetAt(params.neworder, i)#", sortorder=i);
}
renderText("#params.neworder# Sortorder updated");
}
<script>
var gm=$("#mycanvas").gridmanager({
// Add the custom button
customControls: {
global_col: [{ callback: 'insert_image', loc: 'top', iconClass: 'fa fa-file-image-o' }]
}
}).data('gridmanager');
// Function which gets called
function insert_image(container, btnElem) {
@neokoenig
neokoenig / Default.cfc
Created February 10, 2015 10:00
Simple cfwheels route example
/**
* Example controller: add these routes: The order is important in how they get matched. Top down!
*
* // Example Static Route - it's above the user bit so will get precedence
* addRoute(name="about", pattern="/about", controller="pages", action="about");
*
* // Here's our user routes: from this point on, anything like "/foo/" will get interpreted as username = foo etc.
* // These two routes basically mimic wheels defaults, just with the username prefix
* addRoute(name="user", pattern="/[username]/[controller]/[action]/[key]");
* addRoute(name="user", pattern="/[username]/[controller]/[action]/");