Skip to content

Instantly share code, notes, and snippets.

@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"
@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);
component extends='cfselenium.BaseSpec' {
function beforeAll() {
super.beforeAll('http://#CGI.HTTP_HOST#/');
}
function afterAll() {
super.afterAll();
}
@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]

@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 / 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 / build.xml
Created May 11, 2016 20:34
CFML CI Build file
<?xml version="1.0" encoding="utf-8"?>
<project basedir="." default="test" name="CFML CI">
<!--
The CFML CI template project.
For integration instructions, see the Github project page:
https://github.com/coldfumonkeh/cfml-ci
-->
@elpete
elpete / RequestContextDecorator.cfc
Created May 26, 2016 17:31
Simple Request Context Decorator to spoof the HTTP method with hidden _method fields.
component extends='coldbox.system.web.context.RequestContextDecorator' {
string function getHTTPMethod() {
return getRequestContext().getValue('_method', cgi.REQUEST_METHOD);
}
}
@elpete
elpete / DumpCfmlSettings.py
Created June 28, 2016 20:11
Dump out Sublime Text CFML Plugin settings
import sublime, sublime_plugin, json
import CFML
class DumpCfmlSettings(sublime_plugin.WindowCommand):
def run(self):
projects = list(CFML.src.cfcs.cfcs.projects.keys())
self.window.show_quick_panel(projects, lambda i: self.types(projects[i]))
def types(self, project):
dumpTypes = ["Variable Names", "Indexed Files"]