Skip to content

Instantly share code, notes, and snippets.

View falexandre's full-sized avatar
😎

Fábio Luis Alexandre falexandre

😎
View GitHub Profile
@humrochagf
humrochagf / emailchecker.py
Created July 4, 2018 12:57
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'
@sryabov
sryabov / autocomplete.vue
Created June 20, 2018 20:07
vuetify autocomplete component example
<template>
<v-autocomplete
v-model="select"
:loading="loading"
:items="items"
:search-input.sync="search"
no-filter
hide-selected
clearable
return-object
@ksatirli
ksatirli / alternate-bitbucket-pipelines.yml
Last active August 11, 2019 12:29
Bitbucket: push assets to AWS CloudFront
---
pipelines:
cloudfront:
- step:
image: python:3.5.1
script:
- pip install awscli
# set up AWS access credentials incl. region
- export AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
@Component({
selector: 'add-story-form',
template: `
<div class="container">
<h1>New Story</h1>
<form [formGroup]="newStory"
(submit)="submit($event)"
(success)="onSuccess()"
(error)="onError($event)"
connectForm="newStory">
@alexbruno
alexbruno / valid.cnpj.ts
Last active April 23, 2024 13:02
Validação de CNPJ
// Regex para validação de string no formato CNPJ
export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/
// Método de validação
// Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica
export function validCNPJ(value: string | number | number[] = '') {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const isString = typeof value === 'string'
@damien-biasotto
damien-biasotto / Dockerfile
Created July 9, 2016 02:04
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
@lopezjurip
lopezjurip / Caddyfile
Last active June 24, 2017 22:18
Feathers.js + Docker + Caddy | SSL + HTTP2
your.domain.com {
proxy / web:3030 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
websocket
}
tls youremail@gmail.com
}
@p4tin
p4tin / Mongo.go
Created December 13, 2015 18:06
Golang Mongo CRUD Example
package mongo
import (
"time"
"log"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// Profile - is the memory representation of one user profile
@davideicardi
davideicardi / mongo-docker.bash
Last active July 16, 2023 18:18
Running mongodb inside a docker container (with mongodb authentication)
# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--restart)
# and with mongo authentication (--auth)
# Image used is https://hub.docker.com/_/mongo/
docker pull mongo
docker run --name YOURCONTAINERNAME --restart=always -d -p 27017:27017 mongo mongod --auth
# Using the mongo "localhost exception" (https://docs.mongodb.org/v3.0/core/security-users/#localhost-exception)
# add a root user
@larikitty
larikitty / HighCharts-pt-BR-Translation.markdown
Last active April 6, 2017 11:13
HighCharts pt-BR Translation