Skip to content

Instantly share code, notes, and snippets.

Giovani Generali giovanigenerali

Block or report user

Report or block giovanigenerali

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View countries.json
{
"BD": "Bangladesh",
"BE": "Belgium",
"BF": "Burkina Faso",
"BG": "Bulgaria",
"BA": "Bosnia and Herzegovina",
"BB": "Barbados",
"WF": "Wallis and Futuna",
"BL": "Saint Barthelemy",
"BM": "Bermuda",
View yup.js
const validationSchema = Yup.object({
email: Yup
.string()
.trim()
.email('Informe um e-mail válido')
.required('Informe seu e-mail'),
password: Yup
.string()
.min(6, 'A senha deve conter no mínimo 6 caracteres')
.required('Informe sua senha'),
View paises.json
{
"paises": [
{
"codigo": "93",
"pais": "Afeganistão",
"sigla": "AF"
},
{
"codigo": "27",
"pais": "África do Sul",
@giovanigenerali
giovanigenerali / paises-gentilico.json
Last active Jan 8, 2019
Lista de paises em json
View paises-gentilico.json
[
{
"gentilico": "afegãne",
"nome_pais": "Afeganistão",
"nome_pais_int": "Afghanistan",
"sigla": "AF"
},
{
"gentilico": "sul-africana",
"nome_pais": "África do Sul",
@giovanigenerali
giovanigenerali / memory_monitor.config
Created Dec 9, 2018
aws elastic beanstalk - memory monitor
View memory_monitor.config
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html
# .ebextensions/memory_monitor.config
container_commands:
00install:
command: "sudo yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64"
ignoreErrors: false
01download:
command: "curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O"
ignoreErrors: true
02extract:
View getParamsFromURL.js
const getParamsFromURL = (url) => {
return decodeURIComponent(new URL(url).search.substr(1))
.split('&')
.reduce((acc, cur) => {
const [key, value] = cur.split('=')
acc[key] = value
return acc
}, {})
}
const params = getParamsFromURL('https://localhost/resource/?param1=value1&param2=value2');
View environment
eb ssh [machine]
sudo vi /etc/environment
add line:
LANG=pt_BR.utf-8
LC_ALL=pt_BR.utf-8
@giovanigenerali
giovanigenerali / deploy.sh
Last active Aug 25, 2019
AWS EB Deploy Script
View deploy.sh
#!/bin/bash
DATE=$(date '+[%Y-%m-%d %H:%M:%S]')
LABEL=$(git log --pretty=format:"%h" -1)
MESSAGE=$(git log --pretty=format:"%s" -1)
MACHINE=$1
echo "$DATE - $LABEL"
echo $MESSAGE
echo $MACHINE
eb deploy $MACHINE -l "$DATE - $LABEL" -m "$MESSAGE"
@giovanigenerali
giovanigenerali / postfix-gmail-macos.md
Last active Jul 22, 2019
Postfix Gmail relay on macOS Sierra & macOSHigh Sierra
View postfix-gmail-macos.md

Postfix Gmail relay on macOS Sierra & macOSHigh Sierra

1 - Create a file to store our credentials:

sudo vim /etc/postfix/sasl_passwd

2 - Add something like this:

You can’t perform that action at this time.