Skip to content

Instantly share code, notes, and snippets.

View diego3g's full-sized avatar
🚀
Launching a rocket

Diego Fernandes diego3g

🚀
Launching a rocket
View GitHub Profile
import React, {
createContext,
useState,
useCallback,
useContext,
useEffect,
} from 'react';
import AsyncStorage, {
useAsyncStorage,
# 50-character subject line
#
# 72-character wrapped longer description. This should answer:
#
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
#
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
const { resolve } = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
globals: {
Atomics: 'readonly',
@diego3g
diego3g / index.js
Created December 4, 2019 01:35
RSXP Cadastro
import React, { useState, useRef } from 'react';
import {
TouchableWithoutFeedback,
KeyboardAvoidingView,
Keyboard,
Platform,
ActivityIndicator,
Alert,
} from 'react-native';
@diego3g
diego3g / README.md
Created December 3, 2019 19:15
Criação de servidor Node.js

Configuração do servidor

  1. Configurar chave SSH
  2. Criar Droplet
  3. Realizar update e upgrade
  4. Crua usuário adduser deploy e usermod -aG sudo deploy
  5. Cria pasta .ssh pro deploy
  6. cp ~/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
  7. chown -R deploy:deploy .ssh/
  8. chmod 700 .ssh
server {
server_name testdeploy.rocketseat.com.br;
location / {
proxy_pass http://127.0.0.1:3333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@diego3g
diego3g / index.js
Created December 3, 2019 13:02
RSXP Login
import React, { useState, useRef } from 'react';
import {
TouchableWithoutFeedback,
KeyboardAvoidingView,
Keyboard,
Platform,
ActivityIndicator,
} from 'react-native';
import { useSelector, useDispatch } from 'react-redux';
[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}..)
import { useField } from '@rocketseat/unform';
import isFunction from 'lodash/isFunction';
import PropTypes from 'prop-types';
import React, { useEffect, useRef, useMemo } from 'react';
import InputMask from 'react-input-mask';
function Input({ name, label, prepend, append, mask, ...rest }) {
const ref = useRef(null);
const { fieldName, registerField, defaultValue, error } = useField(name);