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 updateKeys from './updateKeys' | |
import { map, toLower } from 'ramda' | |
const x = { | |
ONE: 1, | |
TWO: 2 | |
} | |
const toLowerKeys = updateKeys(toLower) | |
toLowerKeys(x) |
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
alias rmsnap="find ./ -name '*.snap' -delete" |
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 React from "react" | |
let App = () => ( | |
<div> | |
<img data-testid="image" src="" /> | |
<p>hi</p> | |
</div> | |
) | |
export default App |
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 React from "react" | |
let App = () => ( | |
<div> | |
<img src="" /> | |
<p>hi</p> | |
</div> | |
) | |
export default App |
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
# download and run an image | |
docker run image-name | |
# list images | |
docker images | |
# build an image | |
docker build -t image-name <path> | |
# run an image |
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
// let's create a util by composing common utils | |
import { | |
join, | |
map, | |
pipe, | |
reverse, | |
split, | |
tail, | |
toArray, | |
toLower, |
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 replace = replacements => str => { | |
const fragmentsToReplace = Object.keys(replacements).join('|') | |
const regex = new RegExp(fragmentsToReplace, 'g') | |
return str.replace(regex, match => replacements[match]) | |
} |
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
<script> | |
let x | |
</script> | |
<p>markup</p> | |
<style> | |
body { | |
background: white; | |
} |
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 { fromPairs, map, path, pipe, split, tail } from 'ramda' | |
const removeEmptyQuery = filter(complement(isNil)) | |
const getQueryParams = pipe( | |
path(['location', 'search']), | |
tail, | |
split('&'), | |
map(split('=')), | |
fromPairs, |
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 mapObj = (fn, obj) => | |
Object.entries(obj).map(([key, value]) => { | |
return fn(value, key) | |
}) |