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
// ==UserScript== | |
// @name Deus bençoi | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description perguntaram ao dalai lama o mais te supreende na humanidade e ele respondeu: tumba la tumba é o barulho do | |
// @author joao vito | |
// @match https://twitter.com/* | |
// @icon https://www.google.com/s2/favicons?domain=twitter.com | |
// @grant none | |
// ==/UserScript== |
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 random | |
n = 8 | |
def printBoard(n, board): | |
for i in range(n): | |
for j in range(n): | |
print(board[i][j], end=' ') | |
print() |
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
set tabstop=2 softtabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set smartindent | |
syntax on | |
set guicursor= | |
set relativenumber | |
set nu | |
set nohlsearch |
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 * as Yup from 'yup'; | |
import { Formik } from 'formik'; | |
import { FormContainer, ErrorText } from '../../global'; | |
const validationSchema = Yup.object().shape({ | |
email: Yup.string().email('Put a valid email').required("Email is required"), | |
password: Yup.string().min(6).required("Password is required"), | |
}); |
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
export default function Register() { | |
const emailsAlreadyInUse = []; | |
function handleSubmit(values, { | |
setSubmitting, | |
setFieldError | |
}) { | |
setTimeout(() => { | |
if (values.email === 'teste123@teste.com') { | |
setFieldError('email', 'email already registered'); |
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
validate={ | |
values => { | |
let errors = {}; | |
if (emailsAlreadyInUse.includes(values.email)) { | |
errors.email = 'email is already in use'; | |
} | |
return errors; | |
} | |
} |
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 handleSubmit(values, { setSubmitting }) { | |
setTimeout(() => { | |
alert(JSON.stringify(values)); | |
setSubmitting(false); | |
}, 4000) | |
} |
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
<button type="submit" disabled={isSubmitting} > | |
{isSubmitting ? 'Creating account...' : 'Create account'} | |
</button> |
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
export const ErrorText = styled.p` | |
color: red; | |
font-size: .8em; | |
margin-top: 0; | |
`; |
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
{({ handleSubmit, handleChange, values, touched, isSubmitting, errors, handleBlur }) => ( | |
<form onSubmit={handleSubmit}> | |
<input | |
name="name" | |
onChange={handleChange} | |
value={values.name} | |
type="text" | |
placeholder="Full name" | |
/> |
NewerOlder