Skip to content

Instantly share code, notes, and snippets.


Eric Peterson elpete

  • Salt Lake City, UT
View GitHub Profile
elpete / BaseIntegrationSpec.cfc
Last active Oct 16, 2019
Swaps out WireBox mappings for corresponding mocks during a callback.
View BaseIntegrationSpec.cfc
component {
* Swaps out WireBox mappings for corresponding mocks during a callback.
* mappings = { "apiClient" = mockApiClient }
function whileSwapped( struct mappings = {}, any callback, boolean verifyMappingExists = true ) {
var binder = getWireBox().getBinder();
var originalMappings = {};
mappings.each( function( mapping, component ) {
elpete / AddEngineToTravisBuild.cfc
Last active Jul 18, 2018
Update all .travis.yml files for a given user to have a new engine in the matrix
View AddEngineToTravisBuild.cfc
* Description of task
component {
property name="wirebox" inject="wirebox";
function run(
string searchQuery,
string newEngine,
elpete / cloudSettings
Last active Nov 20, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
elpete / App.vue
Created Sep 6, 2017
Nested scoped slots in Vue templates
View App.vue
<manage-lists v-model="items">
<template scope="{ item: user }">
{{ user.firstName }} {{ user.lastName }}
export default {
elpete / App.vue
Last active Oct 15, 2020
v-model binding for custom components and special input types
View App.vue
elpete / UsersHandler.cfc
Last active May 9, 2017
Snapshot Testing in TestBox
View UsersHandler.cfc
component {
function index( event, rc, prc ) {
var criteria = event.valueExists( "active" ) ? { active = } : {};
var users = getInstance( "User" ).findAllWhere( criteria )
.map( function( user ) {
return user.getMemento();
} );
event.renderData( data = users, format = "json" );
elpete / ColdBox.cfc
Last active Apr 28, 2017
A simple function to correctly escape values for Vue props in CFML (example integration with ColdBox)
View ColdBox.cfc
// config/ColdBox.cfc
component {
function configure() {
coldbox.viewsHelper = "includes/helpers/ViewHelper.cfm"
elpete /
Created Apr 21, 2017
Open a github repo from the command line
alias github=GitHub
function GitHub() {
if [ ! -d .git ] ; then
echo "ERROR: This isn't a git directory" && return false;
git_url=`git config --get remote.origin.url`
if [[ $git_url ==* ]] ; then
elpete / Binder.cfc
Created Mar 8, 2017
WireBox Clear Mapping
View Binder.cfc
<!--- clearMapping --->
<cffunction name="clearMapping" output="false" access="public" returntype="any" hint="Clear a mapping by name if it exists" colddoc:generic="struct">
<cfargument name="name" required="true" hint="The name of the mapping to retrieve"/>
<cfset structDelete( instance.mappings, name ) />
<cfreturn this>
<!--- Usage --->
<!--- <cfset application.wirebox.getBinder().clearMapping( "mappingName" ) /> --->
elpete / Lucee Extensions in Docker on Startup.txt
Last active Feb 17, 2017 — forked from anonymous/docker-log.txt
Lucee Extensions in Docker on Startup
View Lucee Extensions in Docker on Startup.txt
2017-02-17T09:37:44Z @guustnieuwenhuis @ are the lucee environment variables implemented in the docker images?
2017-02-17T09:38:07Z @bdw429s @guustnieuwenhuis Can you explain what you mean?
2017-02-17T09:38:59Z @guustnieuwenhuis lucee has environment vraiebles like `` %28full list: <>%29
2017-02-17T09:39:36Z @guustnieuwenhuis I’m wondering if I can set `` in my docker compose file
2017-02-17T09:40:05Z @guustnieuwenhuis like with `SMTP_SERVER` for example
2017-02-17T09:40:22Z @bdw429s Funny, I was about to post about a few of those. I don%27t know enough about Docker, but I assume you can set whatever props you want when starting the container.
2017-02-17T09:47:09Z @bdw429s So a quick note to everyone who was talking to me about how to install Extensions the other day. Micha reminded me of some java system properties that managed to not make it into the docs anywhere. One of th