Skip to content

Instantly share code, notes, and snippets.

View FeMaffezzolli's full-sized avatar

Felipe Maffezzolli FeMaffezzolli

View GitHub Profile
" Must come first because it changes other options
set nocompatible
" [vim-plug] Load plugins
call plug#begin()
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'junegunn/vim-easy-align'
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
Plug 'tpope/vim-bundler'
[alias]
ci = commit
co = checkout
cm = checkout master
cb = checkout -b
st = status -sb
sf = show --name-only
lg = log --pretty=format:'%Cred%h%Creset %C(bold)%cr%Creset %Cgreen<%an>%Creset %s' --max-count=30
incoming = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' ..@{u})
outgoing = !(git fetch --quiet && git log --pretty=format:'%C(yellow)%h %C(white)- %C(red)%an %C(white)- %C(cyan)%d%Creset %s %C(white)- %ar%Creset' @{u}..)
@FeMaffezzolli
FeMaffezzolli / nginx-sample
Last active May 7, 2022 14:36 — forked from diego3g/nodedeploy-server
nginx reverse proxy sample
server {
server_name subdomain.domain.com.br;
location / {
proxy_pass http://127.0.0.1:3333;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@FeMaffezzolli
FeMaffezzolli / README.md
Created March 6, 2020 00:09 — forked from diego3g/README.md
Criação de servidor Node.js

Configuração do servidor

  1. Configurar chave SSH
  2. Criar Droplet
  3. Realizar update e upgrade
  4. Crua usuário adduser deploy e usermod -aG sudo deploy
  5. Cria pasta .ssh pro deploy
  6. cp ~/.ssh/authorized_keys /home/deploy/.ssh/authorized_keys
  7. chown -R deploy:deploy .ssh/
  8. chmod 700 .ssh
const { resolve } = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
globals: {
Atomics: 'readonly',
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
export ANDROID_HOME=~/Android/Sdk
export PATH="$PATH:$ANDROID_HOME/tools"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
# Path to your oh-my-zsh installation.
export ZSH="/Users/diegofernandes/.oh-my-zsh"
export PATH="$PATH:/usr/local/bin"
@FeMaffezzolli
FeMaffezzolli / valida.cnpj.js
Last active September 12, 2020 14:32 — forked from alexbruno/valid.cnpj.ts
Validação de CNPJ
export function cnpjValidation(value) {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const validTypes =
typeof value === 'string' || Number.isInteger(value) || Array.isArray(value)
// Elimina valor não em formato inválido
if (!validTypes) return false
@FeMaffezzolli
FeMaffezzolli / valida.cpf.js
Last active September 21, 2020 03:38
valida.cpf.js
const isValidCpf = (cpfValue) => {
if (!cpfValue) return false
const formatToString = val => {
if (Array.isArray(val)) return val.join('')
if (typeof val === 'string') return val
return null
}
const cpfString = formatToString(cpfValue)
@FeMaffezzolli
FeMaffezzolli / flattenObject.js
Last active June 16, 2020 09:45
Create a flatten object from an any level nested object.
/**
* Creates a flatten object from an any level nested object.
*
* @example
*
* Create following object:
*
* {
* 'address.city.name': 'São Paulo',
* 'address.state.name': 'SP',
@FeMaffezzolli
FeMaffezzolli / objectFromFlatten.js
Last active June 16, 2020 09:43
Create an object from a flattenObject.
/**
* Creates an object from a flattenObject.
*
* @example
*
* Create following object:
*
* {
* address: {
* city: {