Skip to content

Instantly share code, notes, and snippets.

View tpanagos's full-sized avatar

Tim Panagos tpanagos

View GitHub Profile
@tpanagos
tpanagos / testel.groovy
Created July 22, 2021 22:02
Nifi Expression Language Testing from the command-line for 1.12.1
// eg. groovy testEL.groovy -D filename=hello '${filename:append("_world")}'
@Grab(group='org.apache.nifi', module='nifi-expression-language', version='1.12.1')
import org.apache.nifi.attribute.expression.language.*
def cli = new CliBuilder(usage:'groovy testEL.groovy [options] [expressions]',
header:'Options:')
cli.help('print this message')
cli.D(args:2, valueSeparator:'=', argName:'attribute=value',
'set value for given attribute')
def options = cli.parse(args)
@tpanagos
tpanagos / keybase.md
Created February 13, 2019 13:45
keybase.md

Keybase proof

I hereby claim:

  • I am tpanagos on github.
  • I am tpanagos (https://keybase.io/tpanagos) on keybase.
  • I have a public key ASC0Z0hWyVHp2Kehki0au4b6KMJg1n0fqnKLYECVoSMywgo

To claim this, I am signing this object:

@tpanagos
tpanagos / snippet.scala
Created March 22, 2018 16:04
Scala Update Immutable Object
val items = List(Item("Apple","Fruit", 1.50),Item("Pear", "Fruit", 2.00))
val items_on_sale = items.map(_.copy(price = 0.50))
@tpanagos
tpanagos / robot_calls_fact.js
Last active March 22, 2018 16:08
Working Robot Scripts
var lib = require('./libs/helpers');
function main(text, auth) {
var recType = '$$RECTYPE$$';
var id = '$$ID$$';
var tags = [];
var resp1 = lib.readShareByView(auth, recType, id);
if (resp1.err !== 1) {
print('currentCount = ' + JSON.stringify(resp1.meta.currentCount));
print('recType = ' + JSON.stringify(resp1.recType));
resp1.objs.forEach( function(obj) {
@tpanagos
tpanagos / BPMN
Created June 8, 2015 23:32
.ajax call from inside Ember action to trigger PUT /messages/ update
<message id="reviewputmsg" name="reviewputmsg"></message>
<boundaryEvent id="reviewput" name="Message" attachedToRef="review" cancelActivity="false">
<messageEventDefinition messageRef="reviewputmsg"></messageEventDefinition>
</boundaryEvent>
@tpanagos
tpanagos / create
Last active August 29, 2015 14:20
EmberJS AJAX Examples
create: function(){
var model = this.get('controller').get('model');
//generate object
var updateForm = {
recordType: 'com.comcast.questionset',
vars: {
name: model.name,
questions: {
"chatname": "Question of Record",
"inserts": model.inserts,
@tpanagos
tpanagos / gist:72faaa3ceb08f23cdea9
Created April 17, 2015 15:00
wf_optionsOutcome Submit - Pio EmberJS for Wf
actions: {
backDetailsAction: function () {
console.log("backDetails kickoff" + $('[name=wf_optionsOutcome]').val());
$('[name=wf_optionsOutcome]').val('backDetails');
this.set("isSubmitting", true );
// here you could perform your actions like persisting to the server or so
$('#emberForm').submit();
}
}
@tpanagos
tpanagos / gist:4c47344f9460d48b0e10
Created February 25, 2015 20:26
EmberJS Button Submits
actions: {
backDetailsAction: function () {
console.log("backDetails kickoff" + $('[name=wf_optionsOutcome]').val());
$('[name=wf_optionsOutcome]').val('backDetails');
this.set("isSubmitting", true );
// here you could perform your actions like persisting to the server or so
$('#emberForm').submit();
}
}
@tpanagos
tpanagos / states.json
Created November 27, 2014 00:32
States as JSON LABEL/VALUE array
"states": [
{"LABEL":"Alabama","VALUE":"AL"},
{"LABEL":"Alaska","VALUE":"AK"},
{"LABEL":"Alberta","VALUE":"AB"},
{"LABEL":"American Samoa","VALUE":"AS"},
{"LABEL":"Arizona","VALUE":"AZ"},
{"LABEL":"Arkansas","VALUE":"AR"},
{"LABEL":"Armed Forces (AE)","VALUE":"AE"},
{"LABEL":"Armed Forces Americas","VALUE":"AA"},
{"LABEL":"Armed Forces Pacific","VALUE":"AP"},
val paramMap: JsObject = (Try(parameterMap.getValue(execution).asInstanceOf[JsObject]) match {
case Success(myObj: JsObject) => {
myObj
}
case Failure(myException) => {
foo
}
})