Skip to content

Instantly share code, notes, and snippets.

View falexandre's full-sized avatar
😎

Fábio Luis Alexandre falexandre

😎
View GitHub Profile
@falexandre
falexandre / cnpj.validation.js
Created September 29, 2022 21:46 — 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 isString = typeof value === 'string'
const validTypes = isString || Number.isInteger(value) || Array.isArray(value)
// Elimina valor em formato inválido
if (!validTypes) return false
@falexandre
falexandre / ftpClient.py
Created January 5, 2021 23:17 — forked from IuryAlves/ftpClient.py
Cliente FTP implementado em python
# coding: utf-8
from ftplib import FTP
import log
import logging
#log.criarLog()
log.atualizarLog()
# A função abaixa um arquivo definido por 'filename' na pasta definida por local com o nome
# especificado por 'name'
def download(handler, name, filename="musica1.mp3"):
@falexandre
falexandre / emailchecker.py
Created January 5, 2021 23:16 — forked from humrochagf/emailchecker.py
Lendo emails do gmail
# Este é o código de como ler emails do gmail
# discutido no calango, ele foi escrito para rodar em
# python 3
import email
import imaplib
EMAIL = 'calangotestedeemail@gmail.com'
PASSWORD = '@Calango123'
SERVER = 'imap.gmail.com'
@falexandre
falexandre / gitflow-breakdown.md
Created July 24, 2020 13:57 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@falexandre
falexandre / Breakpoints
Created July 15, 2020 01:13 — forked from janily/Breakpoints
Mobile-first CSS Media Queries Breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
https://dkbalachandar.wordpress.com/2016/07/05/thread-dump-from-a-docker-container/
Thread & Heap dumps From a Docker container
Follow the below steps to take the thread and Heap dumps from a docker container
1. Run the below command to bash into the container. Please change the CONTAINER_NAME appropriately
docker exec -it CONTAINER_NAME bash
@falexandre
falexandre / esconde.js
Created November 26, 2018 07:24 — forked from lucianobragaweb/esconde.js
Esconder elementos ao rolar a página.
// Script jQuery para esconder um elemento na página quando a rolagem ultrapassar 200px
$(window).scroll(function(){
if($(document).scrollTop() > 200){// se a rolagem passar de 200px esconde o elemento
$('#elementoAEsconder').hide();
} else { // senão ele volta a ser visivel
$('#elementoAEsconder').show();
@falexandre
falexandre / Dockerfile
Created February 28, 2018 05:14 — forked from damien-biasotto/Dockerfile
Docker Compose CakePHP 3 Nginx + PHP-FPM + MailHog + Phpmyadmin
FROM php:fpm-alpine
RUN apk add --no-cache --update icu-libs icu icu-dev
RUN docker-php-ext-install intl pdo pdo_mysql
@falexandre
falexandre / default.conf
Created January 9, 2018 08:43
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@falexandre
falexandre / nginx.conf
Created January 8, 2018 13:57 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf: