- Configurar chave SSH
- Criar Droplet
- Realizar update e upgrade
- Crua usuário
adduser deploy
eusermod -aG sudo deploy
- Cria pasta
.ssh
prodeploy
cp ~/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
chown -R deploy:deploy .ssh/
chmod 700 .ssh
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 { useState, createContext, useContext } from 'react' | |
// Lift state up -> Levantar o estado | |
// Context API | |
// Prop Drilling | |
type CartContextType = { | |
productsInCart: string[]; | |
addProductToCart: (name: string) => void; |
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 { transactions, balance } = response.data; | |
const newTransactions = transactions.map(transaction => { | |
return { | |
...transaction, | |
formattedValue: formatValue(transaction.value), | |
// outros campos aqui | |
} | |
}); |
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
name: CI | |
on: | |
push: | |
branches: [master] | |
env: | |
BUCKET: reactdeploy.getomni.dev | |
jobs: |
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
.DayPicker { | |
background: #28262e; | |
border-radius: 10px; | |
} | |
.DayPicker-wrapper { | |
padding-bottom: 0; | |
} | |
.DayPicker, |
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, { | |
createContext, | |
useState, | |
useCallback, | |
useContext, | |
useEffect, | |
} from 'react'; | |
import AsyncStorage, { | |
useAsyncStorage, |
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
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 { compose, withState, withHandlers } from 'recompose'; | |
const Dropdown = ({ opened, toggleDropdown }) => ( | |
<div> | |
<button type="button" onClick={toggleDropdown}> | |
Abrir/fechar | |
</button> | |
<ul className={`dropdown ${opened ? 'dropdown-open' : ''}`}> | |
<li>ReactJS</li> |
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
'use strict' | |
const Database = use('Database') | |
const Model = use('Model') | |
const Env = use('Env') | |
class Course extends Model { | |
static get computed () { | |
return ['thumbnailUrl'] | |
} |
OlderNewer