Skip to content

Instantly share code, notes, and snippets.

View neokoenig's full-sized avatar

Tom King neokoenig

View GitHub Profile
<!---------------------------- In /events/onrequeststart.cfm ------------------------>
<cfscript>
// Setup placeholder for JS
request.js={};
</cfscript>
<!---------------------------- In your view File ------------------------>
<cfoutput>
Stuff
</cfoutput>
language: java
sudo: required
services:
- mysql
jdk:
- oraclejdk8
env:
matrix:
- CFENGINE=lucee@4 DBDRIVER=MySQL HOST=localhost PORT=3306
before_install:
component extends="app.controllers.Controller"
/*
Main API Responses used application wide. Should conform to JSONApi Spec
http://jsonapi.org/format/
*/
{
function init() {
provides("json");
filters(through="isValidAPIRequest");
filters(through="requiresAuthentication", except="environment,authenticate");
~\Documents\GitHub> box
BOOM GOES THE DYNAMITE!!
We're truly sorry, but something horrible has gone wrong when starting up Comman
dBox.
Here's what we know:.
Message:
No matching Method/Function for jline.console.completer.CandidateListCompletionH
andler.setPrintSpaceAfterFullCompletion(boolean) found
2017-02-10 13:26:43 ERROR io.undertow.request UT005023: Exception handling request to /wheels/public/assets/css/normalize.min.css
java.lang.StringIndexOutOfBoundsException: String index out of range: 43
at java.lang.String.charAt(String.java:658)
at java.lang.Character.codePointAt(Character.java:4866)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3775)
at java.util.regex.Pattern$Curly.match0(Pattern.java:4260)
at java.util.regex.Pattern$Curly.match(Pattern.java:4234)
at java.util.regex.Pattern$BmpCharProperty.match(Pattern.java:3798)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4658)
at java.util.regex.Pattern$Begin.match(Pattern.java:3525)
@neokoenig
neokoenig / report.xls.cfm
Last active January 26, 2017 21:29
Lazy XLS generation
<cfheader name="Content-Disposition" value="inline; filename=#dateFormat(now(), 'yyyymmdd')#_report.xls">
<cfcontent type="application/vnd.ms-excel">
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<body>
<cfoutput>
<table class="table table-condensed">
<thead>
<tr>
private string function $getDBType() {
local.info = $dbinfo(
type="version",
datasource=application.wheels.dataSourceName,
username=application.wheels.dataSourceUserName,
password=application.wheels.dataSourcePassword
);
if (local.info.driver_name Contains "SQLServer" || local.info.driver_name Contains "Microsoft SQL Server" || local.info.driver_name Contains "MS SQL Server" || local.info.database_productname Contains "Microsoft SQL Server") {
local.adapterName = "MicrosoftSQLServer";
} else if (local.info.driver_name Contains "MySQL") {
@neokoenig
neokoenig / settings.cfm
Created November 23, 2016 10:20
CFWheels Bootstrap3 form defaults
<cfscript>
// BS3 form settings
set(functionName="startFormTag");
set(functionName="submitTag", class="btn btn-primary", value="Save Changes");
set(functionName="checkBox,checkBoxTag", labelPlacement="aroundRight", prependToLabel="<div class=""checkbox"">", appendToLabel="</div>", uncheckedValue="0");
set(functionName="radioButton,radioButtonTag", labelPlacement="aroundRight", prependToLabel="<div class=""radio"">", appendToLabel="</div>");
set(functionName="textField,textFieldTag,select,selectTag,passwordField,passwordFieldTag,textArea,textAreaTag,fileFieldTag,fileField",
class="form-control",
labelClass="control-label",
labelPlacement="before",
<!---Flickr Params--->
<cfparam name="flickr.url" default="https://api.flickr.com/services/rest/" />
<cfparam name="flickr.key" default="YOURFLICKRKEY" />
<cfparam name="flickr.userid" default="123456789@N03">
<cfparam name="flickr.xml" default="">
<!---Send my Request to Flickr: this will get an XML doc with all my public photosets--->
<cfhttp url="#flickr.url#">
<cfhttpparam name="api_key" type="url" value="#flickr.key#" />
<cfhttpparam name="method" type="url" value="flickr.photosets.getList" />
<cfif listFirst(server.coldfusion.productVersion) LT "11">
<!---
Backport of QueryExecute in CF11 to CF9 &amp; CF10
@param sql_statement SQL. (Required)
@param queryParams Struct of query param values. (Optional)
@param queryOptions Query options. (Optional)
@return Returns a query.
@author Henry Ho (henryho167@gmail.com)
@version 1, September 22, 2014