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 csvToJson = csv => { | |
const [firstLine, ...lines] = csv.split('\n'); | |
return lines.map(line => | |
firstLine.split(',').reduce( | |
(curr, next, index) => ({ | |
...curr, | |
[next]: line.split(',')[index], | |
}), | |
{} | |
) |
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'; | |
import createExpo from 'expobook'; | |
import Button from './components/button'; | |
const expobook = createExpo(); | |
expobook.add('My button', () => <Button>Hello World</Button>); | |
expobook.add('My other button', () => <Button>Hello World, again</Button>); | |
export default expobook.build(); |
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
### TIP 1 | |
Get list of transitive dependencies. | |
NOTE: Make sure the second tip is not set if you want to see the full result of this. | |
``` | |
$ cd android | |
$ ./gradlew :app:dependencies | |
``` | |
### TIP 2 |
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 | |
import { forEachField } from 'graphql-tools'; | |
import { get } from 'lodash/fp'; | |
export default (schema: Object) => { | |
forEachField(schema, (field: Object) => { | |
if (field.authenticate) { | |
// eslint-disable-next-line no-param-reassign | |
field.resolve = (...args) => { | |
const [,, context] = args; |
NewerOlder