Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Turley mturley

View GitHub Profile
@mturley
mturley / gist:b95fccae1a8aa4e10121dd36f0296993
Last active Jun 22, 2020
Development resources for reproducing Kogito table performance issues
View gist:b95fccae1a8aa4e10121dd36f0296993

Hi guys, let me know if there is a more appropriate channel for this but I figured we could have a place for async discussion around the Kogito PF stuff within UXD.

For those who want to set up and run the Kogito UI code locally, it's pretty simple. Here's how you can pull down the branches I've been working on with Ajay:

git clone https://github.com/kiegroup/kogito-apps
cd kogito-apps
git remote add mturley https://github.com/mturley/kogito-apps
git fetch mturley
git checkout KOGITO-new-tabledesign
@mturley
mturley / imperative-vs-declarative.md
Last active Jun 25, 2019
Imperative vs. Declarative Programming: The Value of React for Developers
View imperative-vs-declarative.md

Imperative vs Declarative Programming

The Value of React for Developers

Writing code for what we want the page to do, not how we want the browser to do it.

Basic concepts

I've been working on how to try and explain the fundamental difference between the following two concepts of how programming the interactions on a web page can be done. It's important to grasp both in order to understand the main benefit of React from a developer's perspective. There are also design benefits of React such as the ability to reuse and compose isolated components, but that is beyond the scope of this document.

@mturley
mturley / make-tests.sh
Last active Jul 31, 2019
Script for getting started with unit tests in a directory full of new JS code
View make-tests.sh
#!/usr/bin/env bash
pwd
mkdir -p ./__tests__
for file in *
do
if test -f "$file" && [[ $file == *.js ]]
then
testfile="./__tests__/${file/\.js/.test.js}"
if test -f "$testfile"
@mturley
mturley / gist:c7348e5d31e63d7360b2f2ee493c5928
Created Jul 22, 2018
Errors running webpack-dev-server
View gist:c7348e5d31e63d7360b2f2ee493c5928
ERROR in /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/graphql-language-service-utils/dist/validateWithCustomRules.js
Module not found: Error: Can't resolve 'graphql/validation/rules/ExecutableDefinitions' in '/Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/node_modules/graphql-language-service-utils/dist'
@ /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/graphql-language-service-utils/dist/validateWithCustomRules.js 20:18-75
@ /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/graphql-language-service-utils/dist/index.js
@ /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/graphql-language-service-interface/dist/getDefinition.js
@ /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/graphql-language-service-interface/dist/index.js
@ /Users/mturley/.rvm/gems/ruby-2.4.2/bundler/gems/manageiq-graphql-5f68621f2791/~/codemir
View getActivePlaybook.js
const getActivePlaybook = task => {
if (!task || !task.options || !task.options.playbooks) return {};
const { options: { playbooks } } = task;
if (playbooks.pre.status === 'Active') return playbooks.pre;
if (playbooks.post.status === 'Active') return playbooks.post;
return {};
};
const playbooksByTaskId = mostRecentTasks.reduce(
(map, task) => ({
@mturley
mturley / nfo-and-nab-example.txt
Created Jun 27, 2018
n, i, nfo, nit, np, nip and nab. Fish shell aliases and functions for using npm and grabbing package names super quickly.
View nfo-and-nab-example.txt
~/git > nfo ngnx-local Wed Jun 27 18:01:36 2018
npm ERR! code E404
npm ERR! 404 Not found : ngnx-local
npm ERR! 404
npm ERR! 404 'ngnx-local' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
@mturley
mturley / arrow-functions-and-equality.js
Created Jun 24, 2018
More ranting about JavaScript for Jenn
View arrow-functions-and-equality.js
/*
Jenn, I was looking back on the github examples I gave you and realized one more thing:
If you didn't know it already, the ES6 arrow function syntax, has two shorthands
the first one I showed in my example already:
*/
const arrowFn = () => { };
const arrowFn = () => { return thing; };
@mturley
mturley / reducer2.js
Last active Jun 21, 2018
Another example of reducer handler functions, arrow function shorthand for immediate return, and helper functions
View reducer2.js
import {
BLUEPRINTS_FILTER_UPDATE_VALUES,
COMPONENTS_FILTER_UPDATE_VALUES, COMPONENTS_FILTER_ADD_VALUE
} from '../actions/filter';
// const filter = (state = [], action) => {
// switch (action.type) {
// case COMPONENTS_FILTER_ADD_VALUE:
// // ...
// return Object.assign({}, state,
@mturley
mturley / reducer.js
Last active Jun 21, 2018
example of reducer handlers in an object
View reducer.js
import {
BLUEPRINTS_FILTER_UPDATE_VALUES,
COMPONENTS_FILTER_UPDATE_VALUES, COMPONENTS_FILTER_ADD_VALUE
} from '../actions/filter';
// const filter = (state = [], action) => {
// switch (action.type) {
// case COMPONENTS_FILTER_ADD_VALUE:
// // ...
// return Object.assign({}, state,
@mturley
mturley / Wizard.test.js
Created Mar 25, 2018
Merge conflicts in Wizard.test.js
View Wizard.test.js
import React from 'react';
import { mount } from 'enzyme';
<<<<<<< modal-wizard
import { Button, Row, Col, Wizard } from '../../index';
=======
import { Row, Col } from 'react-bootstrap';
import { Button } from '../Button';
import { Wizard } from './index';
import {
You can’t perform that action at this time.