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
// for use inside compose/flow statements, logs without disrupting the data flow | |
export const tapAndLog = <T>(data: T): T => console.log('tapped', data) || data; // eslint-disable-line no-console |
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 const mapObject = R.addIndex(R.map); |
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 const conditional = <T>(predicate: boolean, ifTrue: T => *, ifFalse: T => *) => | |
(value: T) => predicate ? ifTrue(value) : ifFalse(value); |
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
// @flow | |
// Handles empty links with proper defaults and allows mailto links | |
import React, { type Node } from 'react'; | |
import styled from 'styled-components'; | |
import { Link as RouterLink } from 'react-router-dom'; | |
type Props = { | |
link: ?string, | |
children: Node, | |
className?: Object, // gotta pass className to allow styling overrides |
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 unix_timestamp = js_timestamp/1000|0; |
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 percentChance = (probability) => Math.random() <= probability | |
if (percentChance(0.95)) doSomething() |
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 fp from 'lodash/fp'; | |
const uncappedMap = fp.map.convert({ cap: 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
import fp from 'lodash/fp'; | |
const uncappedMap = fp.map.convert({ cap: 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
[ignore] | |
[include] | |
./src/ | |
[libs] | |
[lints] | |
[options] |
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
# to encrypt: | |
openssl enc -in ./auth.json -aes-256-cbc -pass file:./password -out auth.json.encrypted | |
# to decrypt: | |
openssl enc -d -in ./auth.json.encrypted -aes-256-cbc -pass file:./password -out auth.json |