Skip to content

Instantly share code, notes, and snippets.

Avatar
🇧🇷
Brazil

Thiago Marinho tgmarinho

🇧🇷
Brazil
View GitHub Profile
@tgmarinho
tgmarinho / AllowPopup.tsx
Last active Jun 13, 2021
ask permission to user
View AllowPopup.tsx
import React, { useEffect, useState } from "react";
import { Alert, Button, Space } from "antd";
import { getLocalStorage, setLocalStorage } from "@/utils/helpers";
import { KEY_ALLOW_POPUP } from "@/utils/constants";
/**
* It's necessary because when we are using simple create form
* Open a lot of times the popup to login/sign transactions
*/
View useUIUpdater.tsx
import { ButtonAssetsAction } from "@/components/shared/AssetsAction";
import { useRouter } from "next/router";
import { createContext, useContext, useEffect, useReducer } from "react";
interface InitialStateType {
price?: string;
button?: ButtonAssetsAction[] | null;
owner: string;
updated?: boolean;
auction_bids?: number;
@tgmarinho
tgmarinho / .gitconfig
Created Jun 9, 2021
Git Config Aliases
View .gitconfig
[user]
email = tgmarinho@gmail.com
name = Thiago Marinho
[alias]
co = checkout
br = branch
ci = commit
st = status
undo = reset HEAD~1 --mixed
ec = config --global -e
View file.tsx
import useUal from "@/hooks/useUal";
import { ButtonStyled } from "./ButtonStyled";
import { AssetsActionProps } from "@/typings/shared";
import { useCallback, useEffect, useState } from "react";
enum BUTTONS {
NOT_LOGGED = "NOT_LOGGED",
ON_AUCTION = "ON_AUCTION",
ON_SALE = "ON_SALE",
PUT_ON_SALE = "PUT_ON_SALE",
View refactor.tsx
import useUal from "@/hooks/useUal";
import { ButtonStyled } from "./ButtonStyled";
import { AssetsActionProps } from "@/typings/shared";
import { useCallback, useEffect, useState } from "react";
enum BUTTONS {
NOT_LOGGED = "NOT_LOGGED",
ON_AUCTION = "ON_AUCTION",
ON_SALE = "ON_SALE",
PUT_ON_SALE = "PUT_ON_SALE",
View new-version-refactoring.tsx
import useUal from "@/hooks/useUal";
import { ButtonStyled } from "./ButtonStyled";
import { AssetsActionProps } from "@/typings/shared";
import { useCallback, useEffect, useState } from "react";
enum BUTTONS {
NOT_LOGGED = "NOT_LOGGED",
ON_AUCTION = "ON_AUCTION",
ON_SALE = "ON_SALE",
PUT_ON_SALE = "PUT_ON_SALE",
View my-linux-term.md

Linux Terminal with oh-my-zsh

Every step in this tutorial is required for making terminal look as the image below.

terminal view of completed tutorial setup

ZSH & OH-MY-ZSH

sudo apt-get install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
@tgmarinho
tgmarinho / setup-mac.sh
Created May 6, 2021 — forked from santospatrick/setup-mac.sh
MacOSX Setup for Development
View setup-mac.sh
#!/usr/bin/env bash
# 1. Run this script file
# Homebrew & Apps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install --cask discord
brew install --cask spotify
brew install --cask iterm2
@tgmarinho
tgmarinho / backendLearningPath.md
Created Mar 31, 2021 — forked from sibelius/backendLearningPath.md
Backend Learning Path - Basics that you should learn
View backendLearningPath.md
  • learn about basic database modelling, use excalidraw
  • learn how to connect to a database and performe queries
  • learn how to expose a CRUD API REST and/or GraphQL
  • learn how to document the API using Swagger, swagger-jsdoc is the best for it
  • learn how to test your API using Postman, and also automated using jest and supertest
  • learn how to consume other APIs using fetch

Also check Docker Learning Path and Lambda Learning Path

View settings.json
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"editor.fontSize": 18,
"editor.lineHeight": 24,
"editor.formatOnSave": true,
"workbench.colorTheme": "Omni",
"workbench.settings.editor": "json",
"javascript.suggest.autoImports": true,
"typescript.suggest.autoImports": true,