Skip to content

Instantly share code, notes, and snippets.

/help
--programA/
----docs/
------docmarkup.doc
------docchoices.choice
-------/choiceA
-------/choiceB
where docmarkup is the text for this step
.choice is just a line delimited list of the following:
goApp :: App n -> IO n
goApp init = evalStateT (runApp init) initAppState
scheduleGTKStuff :: IO () -> IO ()
scheduleGTKStuff action = do
void $ Gdk.threadsAddIdle GLib.PRIORITY_DEFAULT $ do
action
return False
@IronGremlin
IronGremlin / SOA_Test_Sucks.js
Last active September 22, 2016 20:37
SOATest Functional JS filter statements
var Application = Packages.com.parasoft.api.Application;
var WebBrowserUtil = Packages.webking.api.browser2.WebBrowserUtil;
//set Target Frame
var frameName = 'popupFrame';
//set type of target Element
var targetElementType = 'button';
function getFrameDocument(input, context) {
//This function lets us get a fake document object to work with.
var document = input.getDocument('',frameName);
@IronGremlin
IronGremlin / functionalReact.js
Last active September 9, 2016 00:37
functional React
"use strict";
function ReactFunctor(tag,attr,props,children){
let classArgs = {
render : function render() {
return React.createElement(tag,this.props,this.props.children);
}
};
if (props !== null) Object.assign(classArgs,props);
return React.createElement(React.createClass(classArgs),attr,children);
@IronGremlin
IronGremlin / combinatronicizer.js
Created July 20, 2016 00:55
combinations with least waste
"use strict";
const _L = require('lodash');
function combinationOfSetsWithLeastWaste(targetSet,candidateGroup){
/*
Finds the group of sets whose intersection equals the target set, while
containing the least waste through extraneous or overlapping items.
where candidateGroup is a collection of objects as:
@IronGremlin
IronGremlin / scary_poles.js
Created June 23, 2016 23:10
JS boolean polish notation converter
"use strict";
const AND = 'AND',
OR = 'OR';
function parsePoleBools(arr){
/*
takes:
an array of:
bools and/or functions that evaluate to bools
tokens representing boolean comparison
(all in reverse polish notation order)