Skip to content

Instantly share code, notes, and snippets.

View bdw429s's full-sized avatar
📦
There's a box for that

Brad Wood bdw429s

📦
There's a box for that
View GitHub Profile
@bdw429s
bdw429s / Application.cfc
Created October 27, 2016 17:04
Lucee Server defining data sources and caches from Applicatipn.cfc
this.cache[ 'couchbase' ] = {
class = 'ortus.extension.cache.couchbase.CouchbaseCache',
storage=true,
custom={
bucketName='default'
}
};
this.cache[ 'couchbasecache' ] = this.cache[ 'couchbase' ];
@bdw429s
bdw429s / gist:ddb27521868c77dc97ec742a670000bc
Created April 13, 2017 18:23
Portainer running on a Swarm and monitoring that swarm
docker service create \
--name portainer \
--publish 9000:9000 \
--constraint 'node.role == manager' \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
portainer/portainer \
-H unix:///var/run/docker.sock
@bdw429s
bdw429s / BeerSongTest.cfc
Created September 13, 2017 05:10
BeerSongTest.cfc
component extends="testbox.system.BaseSpec" {
function beforeAll(){
SUT = createObject( 'BeerSong' );
}
function run(){
describe( "My BeerSong class", function(){
@bdw429s
bdw429s / task.cfc
Last active January 11, 2018 06:24
component {
property name='printer' inject='print';
function run() {
var lines = [
// bold text. Bold works on regular output, but not on prompt
'#chr(27)#[1mtest#chr(27)#[0m',
// bold GREEN text. Bold works on prompt but not on regular ouptut!
'#chr(27)#[1m#chr(27)#[32mtest#chr(27)#[0m',
@bdw429s
bdw429s / slackFileDelete.cfc
Last active May 22, 2018 11:01
This is a CommandBox Task Runner that will delete file from your Slack team that are older than 30 days. Please see the first comment for usage instructions.
/**
* Delete Slack files older than 30 days
*/
component {
function run( token='', user='' ) {
if( !token.len() ) {
error( 'Need an API token provided. Edit this task or pass it as ":token=foobar".' );
}
May 07, 2018 10:58:52 AM org.jline.utils.Log logr
FINE: Error creating JNA based terminal: C:\Users\user.name\AppData\Local\Temp\1\jna--337510509\jna1825582816334583471.dll: Access is denied
java.lang.UnsatisfiedLinkError: C:\Users\user.name\AppData\Local\Temp\1\jna--337510509\jna1825582816334583471.dll: Access is denied
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:906)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:881)
component {
function run() {
var terminal = shell.getReader().getTerminal();
var capability = createObject( 'java', 'org.jline.utils.InfoCmp$Capability' );
var keys = createObject( 'java', 'org.jline.keymap.KeyMap' );
var bindingReader = createObject( 'java', 'org.jline.keymap.BindingReader' ).init( terminal.reader() );
keys.bind( capability.key_left.name(), keys.key( terminal, capability.key_left ) );
<cfscript>
/*
This script will take a relative path to a CFC or CFM file in your application, analyze it's corresponding bytecode and
measure approximately how many Bytes of bytecode were generated for each line of your CFML code. There's not any one-to-one
correlation between CFML code and bytecode. Some lines of your source code generate no bytecode such as comments or whitespace.
Other lines of CFML code may generate hundreds of bytes of code.
This is more for the fun of it. It has been tested on Lucee 5.2.9.31. It will not work on Adobe and may cease to work on
future versions of Lucee if the BCEL library is no longer bundled by default.
*/
@bdw429s
bdw429s / task.cfc
Created January 17, 2019 19:09
CommandBox Task Runner to download packages from RiaForge
/**
* Scrape all the binaries from RiaForge
*/
component {
property name="progressableDownloader" inject="ProgressableDownloader";
property name="progressBar" inject="ProgressBar";
function run() {
directoryCreate( resolvePath( 'downloads' ), true, true );
var projects = deserializeJSON( fileRead( 'http://riaforge.org/index.cfm?event=json.projects' ) );
@bdw429s
bdw429s / gist:25db10d3f8a1b4df1826b8eca96e1d8f
Created November 19, 2019 22:27
Lucee missing DNS entries
176.58.112.34 lucee.org
205.210.189.210 download.lucee.org extension.lucee.org release.lucee.org update.lucee.org
99.84.216.74 cdn.lucee.org