Skip to content

Instantly share code, notes, and snippets.

View charleswvs's full-sized avatar

Charles Silva charleswvs

View GitHub Profile
@charleswvs
charleswvs / .git...HEAD
Created February 22, 2024 12:22
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.15+commit.e14f2714.js&optimize=false&runs=200&gist=
ref: refs/heads/main
@charleswvs
charleswvs / type-of-post.md
Created August 21, 2022 10:09
Como ‘typeof var === “object”’ pode quebrar sua aplicação

Como ‘typeof var === “object”’ pode quebrar sua aplicação

Assunto: Desevolvimento, JavaScript Date Created: August 14, 2022 6:58 AM Status: Revisão

Neste post falaremos um pouco sobre o uso de typeof e como isso pode trazer bugs inesperados e irritantes a sua aplicação.

Acredito que em algum momento da sua vida você precisou uma verificação muito similar a esta:

@charleswvs
charleswvs / cloudSettings
Created December 13, 2021 14:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-12-13T14:48:45.200Z","extensionVersion":"v3.4.3"}
@charleswvs
charleswvs / charles.pub.key
Created October 21, 2021 00:40
Charles Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYXC1ARYJKwYBBAHaRw8BAQdA7paQf3J3ulUY5R6KYgqG/gXjmw+S+KvES1wf
Y8cg0xG0J0NoYXJsZXMgV2lsbGlhbiA8d2NoYXJsZXN3MTVAZ21haWwuY29tPoiU
BBMWCgA8FiEEONcrbFwSv6jFglUk75iA9nI5T/YFAmFwtQECGwMFCwkIBwIDIgIB
BhUKCQgLAgQWAgMBAh4HAheAAAoJEO+YgPZyOU/299ABAJJe/Hg8cH8wU6o1cca9
WsBHu5TkWI0UqqPVrlFJxQ4oAQC0UPqg9TexBUyyIsLQGPm0e4j616J2KaNfXjRy
CNR/Dbg4BGFwtQESCisGAQQBl1UBBQEBB0CMSL98Id6FxsHFlBFF4psoC2Q54m1J
5HmR9E5WMb8qeQMBCAeIeAQYFgoAIBYhBDjXK2xcEr+oxYJVJO+YgPZyOU/2BQJh
cLUBAhsMAAoJEO+YgPZyOU/2X08BAJgKQgCkYxSTugCm5qr2p79MuLLrR+ZDNhl4
@charleswvs
charleswvs / masks.js
Created October 8, 2021 01:32
Useful javascript regex masks
export const cpfMask = value => {
if (value) {
if (value.replace(/\D/g, '').length > 11) {
return value
.replace(/\D/g, '') // Remove tudo o que não é dígito
.replace(/^(\d{2})(\d)/, '$1.$2') // Coloca ponto entre o segundo e o terceiro dígitos
.replace(/^(\d{2})\.(\d{3})(\d)/, '$1.$2.$3') // Coloca ponto entre o quinto e o sexto dígitos
.replace(/\.(\d{3})(\d)/, '.$1/$2') // Coloca uma barra entre o oitavo e o nono dígitos
.replace(/(\d{4})(\d)/, '$1-$2'); // Coloca um hífen depois do bloco de quatro dígitos
}
@charleswvs
charleswvs / cloudSettings
Created August 1, 2019 20:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-01T20:07:00.444Z","extensionVersion":"v3.4.1"}
@charleswvs
charleswvs / History|-2253825a|entries.json
Last active October 29, 2022 11:21
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///Users/charleswillian/Documents/Work/Gunar/planx-new/editor.planx.uk/src/api/flowHasReview.ts","entries":[{"id":"adlQ.ts","timestamp":1649116504922},{"id":"X2vd.ts","timestamp":1649117010876},{"id":"xtmO.ts","timestamp":1649117131341},{"id":"4uMV.ts","timestamp":1649118501292},{"id":"pxGP.ts","timestamp":1649118519938},{"id":"aGiq.ts","timestamp":1649203038640},{"id":"zSBv.ts","timestamp":1649337737918},{"id":"hUVK.ts","timestamp":1649337754955},{"id":"0RyV.ts","timestamp":1649337779428},{"id":"mFLY.ts","timestamp":1649337792753},{"id":"yYGR.ts","timestamp":1649371765988},{"id":"EXm6.ts","timestamp":1649373373012}]}
@charleswvs
charleswvs / fbull.cpp
Created October 17, 2017 20:33
Udemy Course - Unreal_Section01_class29
#include "stdafx.h"
#include "fbull.h"
FBullCowGame::FBullCowGame()
{
}
void FBullCowGame::Reset()
{