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
// Usando classe | |
class Counter extends Component { | |
state = { | |
counter: 1, | |
} | |
incrementCounter = () => { | |
this.setState(({ counter }) => ({ counter: counter + 1 })); | |
}; |
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 CreateAccountForm = () => { | |
const [password, setPassword] = useState(''); | |
const [showErrors, setShowErrors] = useState(false); | |
const checkPassword = event => { | |
const { value } = event.target; | |
setShowErrors(value.length < 8); | |
setPassword(value); | |
} |
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 categories = useMemo(() => { | |
return products.reduce((categories, { category }) => { | |
return !category || categories.find(({ id }) => category && category.id === id) | |
? categories | |
: [ | |
...categories, | |
{ | |
id: category.id, | |
value: category.id, | |
label: category.title, |
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
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>App</title> | |
<meta name="Description" content="Best application ever" /> | |
<meta charset="utf-8" /> | |
<meta name="theme-color" content="#333333" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | |
<link rel="shortcut icon" href="/favicon.ico" /> | |
</head> |
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
<!DOCTYPE html> | |
<html lang="pt-br"> | |
<head> | |
<title>App</title> | |
<meta name="Description" content="Best application ever" /> | |
<meta charset="utf-8" /> | |
<meta name="theme-color" content="#333333" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> | |
<link rel="shortcut icon" href="/favicon.ico" /> | |
</head> |
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
System.config({ | |
"paths": { | |
"@/*": "./src/*" | |
} | |
}); |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PS1='[\u@\h \W]$(parse_git_branch)\$ ' |
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
#!/bin/bash | |
PID=$(id -u $USER); | |
GID=$(id -g $USER); | |
mkdir -p ~/.composer/cache; | |
docker run --rm \ | |
-v $(pwd):/app \ | |
-v ~/.composer/cache:/var/www/.composer/cache \ |
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
#!/usr/bin/env bash | |
##################################################### | |
# # | |
# SYSTEM VALIDATION # | |
# # | |
##################################################### | |
##################################################### |
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
# The routes of the project. | |
# | |
# Each route describes how an incoming URL is going to be processed. | |
"http://{all}/": | |
type: upstream | |
upstream: "mymagento:http" | |
redirects: | |
paths: | |
"^/customer/account/forgotpassword/.*": { to: "http://{all}/", regexp: true } |