Skip to content

Instantly share code, notes, and snippets.

View dajester2013's full-sized avatar

Jesse Shaffer dajester2013

View GitHub Profile
@dajester2013
dajester2013 / pom.xml
Last active September 16, 2019 14:26
lucee war app pom
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- project GAV goes here -->
<repositories>
<repository>
<id>lucee-releases</id>
/**
* Copyright 2018 Jesse Shaffer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
* the Software.
@dajester2013
dajester2013 / create-image-from-datacontainer.sh
Created September 21, 2018 17:19
Creates a docker image from a data container
#!/bin/bash
usage()
{
echo "usage: ./publish-data-container.sh -c <Data Container> -i <Image name to create/tag> -f <Folder path to backup> -b <Base image to use for backup container - defaults to alpine:latest>"
}
while getopts c:i:f:b: option
do
case "${option}"
@dajester2013
dajester2013 / Async.cfc
Created March 20, 2017 03:32
Promises and Async
/**
* Thread wrapper for executor functions.
*
* @author Jesse Shaffer
* @license MIT
**/
component accessors=true {
property name="fn" setter=false;
@dajester2013
dajester2013 / Hierarchical data structuring.md
Last active August 30, 2016 02:33
friday code challenge

Challenge:

Convert a flat representation of a hierarchical data into a nested tree structure.

Assumptions:

  • The dataset is already sorted
  • The dataset should be in the form of an RDBMS resultset, however that is represented in your target language
  • Multiple "top-level" nodes may exist, defined as having an empty parentId
['a', 'at', 'cat', 'scat', 'catch'].find((e)=>/.+at/.test(e));
<cfscript>
testsAny = [
// sorted
[true,[1,2,3,4,5]]
,[true,[2,4,6,8,10]]
// 1 swap
,[true,[1,2,3,5,4]]
,[true,[5,2,3,4,1]]
,[true,[1,2,3,5,3]]
@dajester2013
dajester2013 / CFC Tags Test
Last active August 29, 2015 14:16
cfc-based custom tags examples
// Sample output
[{"_DEPTH":1,"_CHILDID":6421},{"_DEPTH":2,"_CHILDID":3838}]
RestAPI = (function () {
var GET='GET', PUT='PUT',POST='POST',DELETE='DELETE',PATCH='PATCH'
,allMethods = [GET,POST,PUT,PATCH,DELETE];
var doRequest = function(method, url, body, callback) {
console.log(arguments);
}
var p = {};
@dajester2013
dajester2013 / RailoCFMLFileSystems.md
Last active February 18, 2021 06:14
Railo CFML-based filesystem interfaces

The following are the two interfaces needed to implement a cfml-based filesystem in Railo.

Steps:

  1. Build implementations of the ResourceProvider and Resource interfaces
  2. Add your ResourceProvider to the Railo config for the application you are working on:
  • <resource-provider arguments="arg1:value1;arg2:value2" component="path.to.YourResourceProvider" scheme="yourscheme"/>
  • Note: the arguments set in the above configuration are passed as a struct to the "args" argument in the ResourceProvider's constructor.