This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// transform object's values | |
// given a object of functions and an object of value | |
// run object of values through object of functions | |
// matched by same prop name | |
export const map = (fieldFns = {} ) => obj => ( | |
Object.keys(obj) | |
.reduce( (newObj, key) => { | |
const fn = fieldFns[ key ]; | |
const originalValue = obj[ key ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const compose = (...fns) => ( | |
(x) => fns.reduceRight( (val, fn) => fn( val ), x ) | |
); | |
export default compose; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Confirm from './Confirm.js'; | |
import styles from './Confirm.css'; | |
import test from 'tape'; | |
import {spy} from 'sinon'; | |
import { shallow } from 'enzyme'; | |
test('<Confirm />', t => { | |
const submitHandler = spy(); | |
const confirmHandler = spy(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SubComponent from 'sub-component'; | |
export default ({title}) => ( | |
<div class="parentComponent"> | |
<SubComponent title={title} /> | |
</div> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Left = function(x) { | |
this.__value = x; | |
}; | |
Left.of = function(x) { | |
return new Left(x); | |
}; | |
Left.prototype.map = function(f) { | |
return this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ( (fn=>true), Array ) => { "true": [], "false": [] } | |
function splitArray(fn, arr) { | |
return arr.reduce((last, current) => { | |
let key = fn( current ).toString(); | |
last[key] = last[key].concat(current); | |
return last; | |
}, { "true": [], "false": [] } ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function dedupeByMatchingObjectsValues( keys , arrayOfObjects ) { | |
return arrayOfObjects.filter( (item, i, inArray) => ( | |
inArray.find( target => ( | |
[].concat(keys).reduce( (bool, key) => bool && item[ key ]===target[ key ], true) | |
))===item | |
)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default ( chunkLength = 20 , sourceArray = [] ) => ( | |
sourceArray.reduce( (accumulated, current, index) => { | |
let chunkN = Math.floor( index/chunkLength ); | |
accumulated[ chunkN ] = ( accumulated[ chunkN ]||[]).concat( current ); | |
return accumulated; | |
}, []) | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default form => { | |
let determineValue = elm => { | |
switch (elm.type) { | |
case "file": | |
return elm.files; | |
case "checkbox": |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--log_gc (Log heap samples on garbage collection for the hp2ps tool.) | |
type: bool default: false | |
--expose_gc (expose gc extension) | |
type: bool default: false | |
--max_new_space_size (max size of the new generation (in kBytes)) | |
type: int default: 0 | |
--max_old_space_size (max size of the old generation (in Mbytes)) | |
type: int default: 0 | |
--max_executable_size (max size of executable memory (in Mbytes)) | |
type: int default: 0 |