This file contains 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
{ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"jest": true | |
}, | |
"plugins": [ | |
"react-native", | |
"jsx-a11y", | |
"import" |
This file contains 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
async function fetchUserAndGroups() { | |
const user = await api.get('/users/diego3g'); | |
const groups = await api.get(`/groups/${user.id}`); | |
groups.map(group => { | |
const groupInfo = await api.get(`/group/${group.id}`); | |
console.log(groupInfo); | |
}); | |
} |
This file contains 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
Promise.all([ | |
api.get('/users/diego3g'), | |
api.get('/phones/diego3g'), | |
]).then([user, phones] => { | |
console.log(user); | |
console.log(phones); | |
}); |
This file contains 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
function asyncFunction(params, callback, err) { | |
var response = // requisição assíncrona | |
if (response.status === true) { | |
callback(response.data); | |
} else { | |
err(response.data); | |
} | |
} | |
asyncFunction( |
This file contains 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 { View, TextInput, Button } from 'react-native'; | |
import { withFormik } from 'formik'; | |
const Form = (props) => ( | |
<View style={styles.container}> | |
<TextInput | |
value={props.values.email} | |
onChangeText={text => props.setFieldValue('email', text)} |
This file contains 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
// store/ducks/auth.js | |
// Action Types | |
export const Types = { | |
LOGIN: 'auth/LOGIN', | |
LOGOUT: 'auth/LOGOUT', | |
}; | |
// Reducer |
This file contains 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
// src/pages/login.js | |
import React from "react"; | |
import { View } from "react-native"; | |
import { Card, Button, FormLabel, FormInput } from "react-native-elements"; | |
import { onSignIn } from "../services/auth"; | |
export default ({ navigation }) => ( | |
<View style={{ paddingVertical: 20 }}> | |
<Card> |
This file contains 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
# ----------------------------------------------------------------- | |
# .gitignore | |
# Bare Minimum Git | |
# https://salferrarello.com/starter-gitignore-file/ | |
# ver 20220128 | |
# | |
# From the root of your project run | |
# curl -O https://gist.githubusercontent.com/salcode/10017553/raw/.gitignore | |
# to download this file | |
# |
This file contains 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 { resolve } = require('path'); | |
module.exports = { | |
env: { | |
browser: true, | |
es6: true, | |
jest: true, | |
}, | |
globals: { | |
Atomics: 'readonly', |
This file contains 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] | |
ci = commit | |
co = checkout | |
cm = checkout master | |
cb = checkout -b | |
st = status -sb | |
sf = show --name-only | |
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30 | |
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u}) | |
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..) |
OlderNewer