This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name status.ptotall.app; | |
index index.php index.html; | |
root /src/ServerStatus/public; | |
# return 301 https://$host$request_uri; | |
location /nginx { | |
stub_status on; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demonstration video can be found at: https://youtu.be/_gJyK1-NGq8 | |
// ModifyEC2InstanceType | |
const AWS = require('aws-sdk'); | |
exports.handler = (event, context, callback) => { | |
const { instanceId, instanceRegion, instanceType } = event; | |
const ec2 = new AWS.EC2({ region: instanceRegion }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FORMAT='- %s ' | |
SUFFIX='homolog'; | |
echo "## CHANGELOG" | |
echo ---------------------- | |
git for-each-ref --sort='*authordate' --format='%(tag)' refs/tags | tac | grep -v '^$' | grep "${SUFFIX}" | while read TAG ; | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git for-each-ref --sort=taggerdate --format '%(tag)_,,,_%(taggerdate:raw)_,,,_%(taggername)_,,,_%(subject)' refs/tags \ | |
| awk 'BEGIN { FS = "_,,,_" } ; { t=strftime("%Y-%m-%d %H:%M",$2); printf "%-20s %-18s %-25s %s\n", t, $1, $4, $3 }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ---- Config | |
ENV_NAME="Homologação" | |
TAG_SUFFIX="homolog" | |
PROJECT_NAME="Scania Journey Event" | |
PROJECT_PATH_HOST="/home/lfalmeida/Projects/GitHooks/prod/" | |
PROJECT_PATH_DOCKER="/src/projeto" | |
SLACK_WEBHOOK="" | |
ENABLE_SLACK_POST=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:5.6-fpm | |
RUN echo America/Sao_Paulo | tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata | |
RUN apt-get update -y && apt-get install -y libpng-dev | |
RUN buildDeps="libpq-dev libzip-dev libicu-dev wget git python-pip python-psycopg2 gnupg" && \ | |
apt-get update && \ | |
apt-get install -y $buildDeps --no-install-recommends && \ | |
#apt-get install -y postgresql-client && \ | |
docker-php-ext-install \ | |
pdo \ | |
pdo_pgsql \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Definimos uma interface para o cálculo do frete | |
*/ | |
interface ShippingCalculatorInterface | |
{ | |
// Deve receber a instância do pedido que o frete será calculado | |
public function calculate(Order $order); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$var = "yes"; | |
var_dump(filter_var($var, FILTER_VALIDATE_BOOLEAN)); | |
# A saída do código acima seria: | |
# bool(true) | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
printMessage () { | |
if [ $# -eq 0 ]; then | |
echo "Usage: printMessage MESSAGE [printMessage_CHARACTER]" | |
return 1 | |
fi | |
echo "" | |
echo "" | |
printf -v _hr "%*s" 80 && echo -en ${_hr// /${2--}} && echo -e "\r\033[2C$1" |
NewerOlder