Skip to content

Instantly share code, notes, and snippets.

View hugoalmeidahh's full-sized avatar
👨‍💻
Coding!!!

Hugo Almeida hugoalmeidahh

👨‍💻
Coding!!!
View GitHub Profile
import { useState, createContext, useContext } from 'react'
// Lift state up -> Levantar o estado
// Context API
// Prop Drilling
type CartContextType = {
productsInCart: string[];
addProductToCart: (name: string) => void;
const { transactions, balance } = response.data;
const newTransactions = transactions.map(transaction => {
return {
...transaction,
formattedValue: formatValue(transaction.value),
// outros campos aqui
}
});
name: CI
on:
push:
branches: [master]
env:
BUCKET: reactdeploy.getomni.dev
jobs:
.DayPicker {
background: #28262e;
border-radius: 10px;
}
.DayPicker-wrapper {
padding-bottom: 0;
}
.DayPicker,
import React, {
createContext,
useState,
useCallback,
useContext,
useEffect,
} from 'react';
import AsyncStorage, {
useAsyncStorage,
const { resolve } = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
globals: {
Atomics: 'readonly',
@hugoalmeidahh
hugoalmeidahh / README.md
Created June 23, 2021 02:44 — forked from diego3g/README.md
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
function asyncFunction(params, callback, err) {
var response = // requisição assíncrona
if (response.status === true) {
callback(response.data);
} else {
err(response.data);
}
}
asyncFunction(
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>
'use strict'
const Database = use('Database')
const Model = use('Model')
const Env = use('Env')
class Course extends Model {
static get computed () {
return ['thumbnailUrl']
}