python3 -m venv env
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
collections=( collectionName1 collectionName2 collectionName3 collectionName4 ) | |
for c in ${collections[@]} | |
do | |
mongodump \ | |
--uri "..." \ | |
--collection=$c \ | |
--out "$(pwd)/staging/$(date +"%m-%d-%y")" | |
done |
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
/** | |
* series :: array -> Promise | |
* | |
* Run the functions in the tasks collection in series, | |
* each one running once the previous function has completed. | |
*/ | |
const series = tasks => | |
tasks.reduce( | |
(prevPromise, nextPromise) => prevPromise.then(nextPromise), | |
Promise.resolve() |
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
/** | |
* runPromisesSync :: (array, function) -> Promise | |
* | |
* Runs a list of functions that return a Promise one by one | |
* promisesFactoryMap - a list of functions that return a promise | |
*/ | |
const runPromisesSync = (promisesFactoryMap, onError = defaultOnError) => | |
promisesFactoryMap.reduce( | |
(prevPromise, nextPromise) => prevPromise.then(nextPromise).catch(onError), | |
Promise.resolve() |
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 allIsTrue = R.curry((predicates, object) => | |
Object.key(predicates).reduce((acc, key) => { | |
const predicate = predicates[key]; | |
const predicateType = typeof predicate; | |
const value = object[key]; | |
const valueType = typeof value; | |
if (predicateType === 'function') { | |
return predicate(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
export const phoneFormatter = phone => | |
phone ? phone.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2 - $3') : null; |
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
mogrify -format jpg *.png |
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 styled from 'styled-components'; | |
import { SORT_ORDERS } from './constants'; | |
const { ASC, DESC } = SORT_ORDERS; | |
const SortIcon = styled.span` | |
margin-left: 0.5em; | |
height: 1em; | |
vertical-align: middle; |
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
.text-truncate { | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
} | |
/* https://justmarkup.com/log/2015/07/dealing-with-long-words-in-css/ */ | |
.hyphenate { | |
overflow-wrap: break-word; | |
word-wrap: break-word; |
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 withProps = input => WrappedComponent => props => ( | |
<WrappedComponent {...props} {...input} /> | |
); |