Skip to content

Instantly share code, notes, and snippets.

View thiagobutignon's full-sized avatar

Thiago Butignon Claramunt thiagobutignon

  • 14:16 (UTC -03:00)
View GitHub Profile
// Entra quando a célula é clicada
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let cell = collectionView.cellForItem(at: indexPath) as? CB3DSelectCell {
cell.select(animated: true)
// if cell.isSelected {
// cell.select(animated: false)
// if indexPath.row == 0 {
// self.dataprovider?.routeToSignUPMerchantPerson()
// } else {
import UIKit
extension UIView {
func anchorSize(height: NSLayoutDimension?, width: NSLayoutDimension?, multiplier: CGFloat) {
if let height = height {
heightAnchor.constraint(equalTo: height, multiplier: multiplier)
}
import Foundation
protocol CriarUsuarioPresenter: class {
func success()
func failed()
}
class CriarUsuario {
var delegate: CriarUsuarioPresenter?
@thiagobutignon
thiagobutignon / Debug.js
Created January 15, 2020 02:08
Debug Formik
import React from "react";
import { FormikConsumer } from "formik";
export const Debug = () => (
<div
style={{
margin: "3rem 0",
borderRadius: 4,
background: "#f6f8fa",
import React from 'react';
import { IoIosPin, IoMdHome } from 'react-icons/io';
import { TiSortNumerically } from 'react-icons/ti';
import { FaBuilding } from 'react-icons/fa';
import { Form, InputGroup, FormControl } from 'react-bootstrap';
import { Formik, FormikProps } from 'formik';
import cep from 'cep-promise';
{touched.zipcode && !errors.zipcode
? setTimeout(() => {
cep(values.zipcode)
.then(response => {
setFieldTouched('zipcode', false);
console.log(response);
setFieldValue('street', response.street);
setFieldValue('city', response.city);
setFieldValue('state', response.state);
setFieldValue('neighborhood', response.neighborhood);
import Foundation
struct Character: Model {
let id: Int
let name, resultDescription: String
let modified: Date
let thumbnail: Image
let resourceURI: String
let comics, series: ComicsList
let stories: StoryList
import React from 'react'
import { Router } from 'react-router-dom'
import { createMemoryHistory } from 'history'
import faker from 'faker'
import {
render,
RenderResult,
fireEvent,
cleanup,
waitFor
import faker from 'faker'
import { AddAccount } from '@/domain/usecases'
import { mockAccountResultModel } from '@/domain/test'
export const mockAddAccountParams = (): AddAccount.Params => {
const password = faker.internet.password()
return {
fullName: faker.name.findName(),
username: faker.internet.userName(),
email: faker.internet.email(),
@thiagobutignon
thiagobutignon / AuthorizationDecorator.swift
Last active September 17, 2020 20:47
AuthorizationDecorator
class AuthorizationDecorator: HttpClient {
private let httpClient: HttpClient
public init(httpClient: HttpClient) {
self.httpClient = httpClient
}
public func request(data: HttpRequest, completion: @escaping (Result<Data?, HttpError>) -> Void) {
let getToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiaWF0IjoxNjAwMzczNTczLCJleHAiOjE2MDA0NTk5NzN9.kKCRLckJdCaSMks6WBDX52wIAB92E8wTnHgPix3PxW4"
data.headers!["Authorization"] = "Bearer \(getToken)"