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
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 ) );
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)
@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".' );
}
@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 / 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 / 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 / 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' ];
echo( ['a', 'at', 'cat', 'scat', 'catch'].filter( function( i ) { return reFind( '.+at', i ) } ).first() )
component {
this.name = "<application-name>"; // name of the application context
// regional
// default locale used for formating dates, numbers ...
this.locale = "en_US";
// default timezone used
this.timezone = "America/Chicago";
@bdw429s
bdw429s / gist:3003ba56073d759b39aa
Created June 11, 2015 22:11
Stored Procedure Shim for Railo
<cfcomponent displayName="Stored Procedure Shim for Railo" accessors="true">
<cfproperty name="datasource" type="string" required="true" default="">
<cfproperty name="procedure" type="string" required="true" default="">
<cfproperty name="username" type="string" required="false" default="">
<cfproperty name="password" type="string" required="false" default="">
<cfproperty name="params" type="array" required="false">
<cfproperty name="procResults" type="array" required="false">
<cfproperty name="procResultSets" type="struct" required="false">