Skip to content

Instantly share code, notes, and snippets.

@elpete
elpete / .travis.yml
Last active April 29, 2018 02:06
Multi-engine CI for Travis with CommandBox 3.1.0
language: java
sudo: required
jdk:
- oraclejdk8
cache:
directories:
- $HOME/.CommandBox
env:
matrix:
- ENGINE=lucee@4.5
@elpete
elpete / AbstractQueryFilters.cfc
Last active May 18, 2017 16:16
Showing how qb makes a filter object a possibility
// Any Query Filter will loop through the request context
// see if any of the keys match functions on the concrete class,
// and if they do, call the function with the value in the request context.
component {
function apply(rc, query) {
variables.query = arguments.query;
for (var key in rc) {
if (structKeyExists(variables, key) && isCustomFunction(variables[key]) {
@elpete
elpete / Application.cfc
Last active October 7, 2016 19:24
Default runner for TestBox
component {
this.name = 'TestBoxTestingSuite' & hash(getCurrentTemplatePath());
this.sessionManagement = true;
this.sessionTimeout = createTimeSpan(0, 0, 15, 0);
this.applicationTimeout = createTimeSpan(0, 0, 15, 0);
this.setClientCookies = true;
this.mappings['/tests'] = getDirectoryFromPath(getCurrentTemplatePath());
rootPath = REReplaceNoCase(this.mappings['/tests'], 'tests(\\|/)', '');
@elpete
elpete / roman-numerals-calculator-code-kata.md
Last active March 2, 2016 21:31
Roman Numerals Calculator Code Kata

Testing Katas

Credits

Borrowed heavily from Laracasts.com. Go give Jeffrey money and learn a ton!

The Purpose

To learn Test-driven Development (TDD) with simple examples.

@elpete
elpete / index.html
Created February 24, 2016 19:44 — forked from anonymous/index.html
JS Bin Quick Selection Box // source http://jsbin.com/nigaki
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Quick Selection Box">
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
@elpete
elpete / cfml-general-log.md
Last active January 23, 2016 18:06 — forked from anonymous/cfml-general-log.txt
Slack Chat about OOP in CFML

OOP in CFML Discussion

CFML Slack

January 14, 2016

Unrelated messages omitted for brevity.

Punctuation and spelling not touched.

tbrown [11:14 AM]

component extends='cfselenium.BaseSpec' {
function beforeAll() {
super.beforeAll('http://#CGI.HTTP_HOST#/');
}
function afterAll() {
super.afterAll();
}
@elpete
elpete / forLoop.cfm
Last active November 23, 2015 23:51
Issues using the `arguments` scope with `for` loops
<cfscript>
function dumpOutput(filters = {}) {
for (var key in arguments.filters) {
writeDump({
key = key,
value = arguments.filters[key],
struct = arguments.filters
});
}
@elpete
elpete / structEach.cfm
Last active November 23, 2015 23:52
Issues using the `arguments` scope with `StructEach`
<cfscript>
function dumpOutput(filters = {}) {
arguments.filters.each(function(key, value, struct) {
writeDump(arguments);
});
}
function dumpByPassingArguments() {
dumpOutput(filters = arguments);
@elpete
elpete / aliases.sh
Created November 18, 2015 17:58
CommandBox Toggle Command and Aliases
# CommandBox
alias bss="box server toggle"
alias bsa="box server stop --all"
alias bfa="box server forget --all --force"
alias bsfa="box server stop --all --forget"