Skip to content

Instantly share code, notes, and snippets.

const runDynamicFieldProperties = (field, excludeProps = []) => (
Object.keys(field).reduce((acc, curr) => {
const currVal = field[curr];
const isFunc = (typeof currVal === 'function');
const isExcluded = excludeProps.some(key => key === curr);
const isMatch = isFunc && !isExcluded;
return Object.assign({}, acc, {
[curr]: isMatch ?
currVal({
data: acc,
@kwelch
kwelch / webpack.config.dev.js
Last active June 25, 2019 02:56
Webpack React-Toolbox & Non-CSS
import webpack from 'webpack';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import autoprefixer from 'autoprefixer';
import path from 'path';
// all directories that have css that should use cssModules should be listed here
const cssModulesPath = [
path.resolve(__dirname, 'src'),
path.resolve(__dirname, 'node_modules/react-toolbox'),
];
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter as Router, Match, Miss }from 'react-router';
import AuthenticatedMatch from '../AuthenticatedMatch';
import styles from './App.scss';
import Header from './Header';
import Footer from './Footer';
import configureStore from '../../store/configureStore';
import RoleActions from '../../actions/roles';
@kwelch
kwelch / mocha-test.spec.js
Created April 27, 2017 14:36
Mocha Chai Component Test Enzyme
import React from 'react';
import chai, { expect } from 'chai';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import EditPageView from './EditPageView';
import FormControl from './FormControl';
import ErrorList from './errorList';
chai.use(sinonChai);
@kwelch
kwelch / readme.md
Last active February 19, 2019 06:27
React Slingshot OSX Setup

OSX Setup for React-Slingshot

This is a guide of how I setup my mac to run react-slingshot the for the first time.

  • Installed (homebrew)[https://brew.sh/]
    • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Installed (nvm)[https://github.com/creationix/nvm]
    • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.4/install.sh | bash
  • Used nvm to install node 6.11
  • run npm install
@kwelch
kwelch / daily-notes-template.md
Last active November 14, 2017 03:11
daily-notes

Morning Checklist

  • Review yesterday's notes

TODO

@kwelch
kwelch / .prettierrc
Last active November 2, 2019 04:00
Talks
{ "printWidth": 120 }
@kwelch
kwelch / rapidFileSaver.js
Created December 5, 2018 21:21
Rapid File Saver
var fs = require('fs');
var path = require('path');
const TEMP_FILE_PATH = path.resolve(__dirname, '../../src/playground/tempFile.js');
// Recommendation: Do not set lower than 200ms
// File changes that quickly will not allow webpack to finish compiling
const REWRITE_TIMEOUT_MIN = 200;
const REWRITE_TIMEOUT_MAX = 300;
@kwelch
kwelch / review.md
Created December 23, 2018 15:10
Year in review

With the holidays upon us, I find myself looking toward the excitement of the new year. a lot of my thoughts have been on the next projects at work or family trips. right now though I was to shift the view to where I see myself by next year.