Skip to content

Instantly share code, notes, and snippets.

View FeMaffezzolli's full-sized avatar
👨‍💻
working

Felipe Maffezzolli FeMaffezzolli

👨‍💻
working
View GitHub Profile
@FeMaffezzolli
FeMaffezzolli / shuffleArray.ts
Last active September 12, 2020 14:36 — forked from snowman-repos/gist:3820849
JavaScript: Shuffle Array
/**
* Respect immutability folks.
*/
const toBeSortedNewArray = [...originalArray]
toBeSortedNewArray.sort(() => return 0.5 - Math.random());
@FeMaffezzolli
FeMaffezzolli / easing.js
Created August 18, 2020 00:24 — forked from gre/easing.js
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
// no easing, no acceleration
linear: t => t,
// accelerating from zero velocity
easeInQuad: t => t*t,
// decelerating to zero velocity
@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
# 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"
const { resolve } = require('path');
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
},
globals: {
Atomics: 'readonly',
@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
@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;
[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}..)
" 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'