Skip to content

Instantly share code, notes, and snippets.

.ui.top.inverted.labeled.menu .title.glow {
background: radial-gradient(450px 250px at top left,#000,rgba(90,80,118,0))
}
.two.column.diff .diff.line:not(.keep) .line.wrapper:not(.empty) .left.line.content {
background-color: #FBDDDD; /* rgba(91, 220, 114, 0.20) on white */
}
.two.column.diff .diff.line.base:not(.keep) .line.wrapper:not(.empty) .left.line.content,
.two.column.diff .diff.line.whitespace:not(.keep) .line.wrapper:not(.empty) .left.line.content {
background-color: #FFF7F7; /* rgba(91, 220, 114, 0.05) on white */
}
@giovanigenerali
giovanigenerali / 00-https-single-instance.yaml
Created July 31, 2021 20:59 — forked from the-vampiire/00-https-single-instance.yaml
AWS EB elastic beanstalk single instance nodejs nginx SSL/HTTPS ebextensions config file
# REQUIREMENTS
# set the following configuration environment variables at: configuration -> software -> modify -> environment variables
# CERT_EMAIL: the email address used for registering the cert
# CERT_DOMAIN: the domain to create a cert for
# EB environment URL (listed at the top of the environment page) or a custom domain, custom domains must have a DNS CNAME record pointing to the EB environment URL
# !! MUST NOT have "http://" prefix or the trailing "/" at the end !!
# EXAMPLES
@giovanigenerali
giovanigenerali / countries.json
Last active August 25, 2019 13:00
countries names
{
"BD": "Bangladesh",
"BE": "Belgium",
"BF": "Burkina Faso",
"BG": "Bulgaria",
"BA": "Bosnia and Herzegovina",
"BB": "Barbados",
"WF": "Wallis and Futuna",
"BL": "Saint Barthelemy",
"BM": "Bermuda",
@giovanigenerali
giovanigenerali / yup.js
Last active August 2, 2019 11:13
Yup test()
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'),
@giovanigenerali
giovanigenerali / memory_monitor.config
Created December 9, 2018 12:50
aws elastic beanstalk - memory monitor
# 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:
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');
@giovanigenerali
giovanigenerali / deploy.sh
Last active July 31, 2021 20:59
AWS EB Deploy Script
#!/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 December 20, 2021 20:07
Postfix Gmail relay on macOS Sierra & macOSHigh Sierra

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: