Skip to content

Instantly share code, notes, and snippets.

View feliperodriguess's full-sized avatar
👨‍💻

Felipe Rodrigues feliperodriguess

👨‍💻
  • Florianópolis, Brazil
  • 02:33 (UTC -03:00)
View GitHub Profile
root = true
[*]
ident_style = space
ident_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@feliperodriguess
feliperodriguess / .gitconfig
Last active June 25, 2020 15:20
👾 git alias
[alias]
sync = remote add origin
ci = "!f() { git commit -m \"$*\"; }; f"
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
ps = push
pom = push origin master -u
@feliperodriguess
feliperodriguess / hyper.js
Created July 12, 2020 19:16
💻 Hyper Terminal - Windows Config
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: 'Fira Code, Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// default font weight: 'normal' or 'bold'
fontWeight: 500,
@feliperodriguess
feliperodriguess / reset.css
Last active May 16, 2021 00:18
CSS First Clean Config
@import url('https://fonts.googleapis.com/css?family=Roboto:400,700,800&display=swap');
* {
margin: 0;
padding: 0;
outline: 0;
box-sizing: border-box;
}
body {
@feliperodriguess
feliperodriguess / index.html
Last active May 16, 2021 00:24
Next.js Meta Tags
<meta httpEquiv="x-ua-compatible" content="IE=edge,chrome=1" />
<meta name="MobileOptimized" content="320" />
<meta name="HandheldFriendly" content="True" />
<meta name="theme-color" content="#121214" />
<meta name="msapplication-TileColor" content="#121214" />
<meta name="referrer" content="no-referrer-when-downgrade" />
<meta name="google" content="notranslate" />
<meta property="og:title" content={pageTitle} />
<meta property="og:description" content={description} />
const { resolve } = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
globals: {
Atomics: 'readonly',
@feliperodriguess
feliperodriguess / google-map.jsx
Created July 28, 2021 18:57
Toggle StreetView helper
const toggleStreetView = useCallback(() => {
const panorama = mapRef.current.getStreetView()
panorama.setPosition({
lat: -16.7033165,
lng: -49.2747676,
})
panorama.setPov({
heading: 265,
pitch: 0,
})
import { useState, useEffect, useContext, createContext } from 'react'
import axios from 'axios'
const FetchContext = createContext()
const url = 'https://jsonplaceholder.typicode.com/posts'
const FetchProvider = ({ children }) => {
const [posts, setPosts] = useState([])
@feliperodriguess
feliperodriguess / helpers.js
Created August 27, 2021 00:00
Create Form Data / Create Form Data Documents - FE integration helpers
// Usage: dispatch(upload(createFormDataDocuments([...event.target.files])))
export const createFormData = (data, isCamelized = false) => {
const formData = new FormData()
Object.keys(data).forEach(field => {
const fieldValue = data[field]
const formDataValue = (() => {
if (!fieldValue) {
return ''
}
@feliperodriguess
feliperodriguess / useWallet.ts
Created October 6, 2021 16:43
useMetamaskWallet hook w/ TypeScript
import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
import { ethers } from 'ethers';
declare global {
interface Window {
ethereum: {
on: (method: string, callback?: (arg: any) => void) => Promise<any>;
request: (args: EthereumRequestArguments) => Promise<any>;
removeListener: (method: string, callback?: (arg: any) => void) => Promise<any>;
selectedAddress: string;