Skip to content

Instantly share code, notes, and snippets.

View GuilhermeSantos001's full-sized avatar
🏠
Working from home

GuilhermeSantos GuilhermeSantos001

🏠
Working from home
View GitHub Profile
@GuilhermeSantos001
GuilhermeSantos001 / SocketContext.js
Created November 25, 2022 21:29
Socket Provider
import React, { createContext, useContext, useEffect, useState } from 'react'
import { io } from 'socket.io-client'
import { useSelector } from 'react-redux'
const SocketContext = createContext({ socket: null })
const SocketProvider = (props) => {
const [socket, setSocket] = useState(null)
const { userData } = useSelector((state) => state.user)
@GuilhermeSantos001
GuilhermeSantos001 / countries.enum.ts
Created May 22, 2022 03:33 — forked from kyranjamie/countries.enum.ts
TypeScript enum Country Codes ISO 3166
export enum Country {
Afghanistan = 'AF',
AlandIslands = 'AX',
Albania = 'AL',
Algeria = 'DZ',
AmericanSamoa = 'AS',
Andorra = 'AD',
Angola = 'AO',
Anguilla = 'AI',
Antarctica = 'AQ',
@GuilhermeSantos001
GuilhermeSantos001 / vscode-launch.json
Last active September 11, 2021 02:19
Arquivo de parametrização do Debug do Visual Studio Code
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "Application",
"request": "attach",
"protocol": "inspector",
"port": 9329,
"restart": true,
@GuilhermeSantos001
GuilhermeSantos001 / vscode-settings.json
Last active October 31, 2021 06:12
Configurações do Visual Studio Code
{
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"git.autofetch": true,
"cSpell.language": "en, pt, pt-BR",
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
@GuilhermeSantos001
GuilhermeSantos001 / mongodb.js
Created June 3, 2021 15:21
Truly Mittal -> Learn MongoDB in 50 minutes (Crash Course 2020)
/* Cheatsheet for MongoDB
Created by: Truly Mittal
Date: March 2019
*/
/* SHOW DATABASE */
show dbs
/* USE DATABASE */
use DATABASE_NAME
@GuilhermeSantos001
GuilhermeSantos001 / join_complexity.js
Last active April 19, 2021 17:18
Conversão complexa de uma lista de comandos passados por string, por exemplo: debug on color tasks welcome. O script irá executar this.enableDebug("color", "tasks", "welcome");
let command = answers['command'].toLowerCase(),
args = command.split(' ').slice(1),
params = args.slice(1);
if (command.search(/[debug]/g) == 0) {
if (args[0] === 'on') {
let join = params.join(','),
i = 0, l = join.length, quote = false,
newJoin = '\"';
if (join.indexOf(',') != -1) {
@GuilhermeSantos001
GuilhermeSantos001 / metatags.html
Created March 31, 2021 11:15 — forked from diego3g/metatags.html
Meta tags do curso de Next.js
<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} />