Skip to content

Instantly share code, notes, and snippets.

View AnthonyMRodrigues's full-sized avatar

Anthony Rodrigues AnthonyMRodrigues

View GitHub Profile
@AnthonyMRodrigues
AnthonyMRodrigues / calculator.py
Last active February 24, 2023 18:10
Calculator improvement example
# This is a calculator improvement used in the Medium post example.
# Original code without improvements available here: https://github.com/sobolevn/python-code-disasters/blob/master/python/my_first_calculator.py
def calculate(number1: int, number2: int, op_sign: str) -> float:
mapper = {
"+": number1 + number2,
"-": number1 - number2,
"/": number1 / number2,
"*": number1 * number2
}
@AnthonyMRodrigues
AnthonyMRodrigues / configure_mfa.sh
Last active March 18, 2022 14:03
This script receives the serial number, profile name and the token to generate and replace the aws session configuration.
#!/bin/bash
if [ $# -eq 0 ]; then
printf "Utilization:\n"
printf "$0 [[--token|-t] <MFA Token>] [[--serial_number|-s] <Serial Number>] [[--profile|-p] <Profile>]\n"
exit 1
fi
serial_number=${AWS_ARN_SESSION}
profile=${AWS_SESSION_PROFILE:-"mfa"}
@AnthonyMRodrigues
AnthonyMRodrigues / git-update-fork.sh
Created October 5, 2017 16:18 — forked from rdeavila/git-update-fork.sh
Git: como atualizar um fork com as mudanças do original?
#!/bin/bash
# Adicione um novo remote; pode chamá-lo de "upstream":
git remote add upstream https://github.com/usuario/projeto.git
# Obtenha todos os branches deste novo remote,
# como o upstream/master por exemplo:
git fetch upstream
<div class="panel-body">
<div class="form-group">
{!! Form::label('description','Descrição',['class' => 'control-label col-sm-4']) !!}
<div class="col-md-3">
{!! Form::text('description',null,['class'=>'form-control','maxlength'=>'100','placeholder'=>'Ex. Time 1']) !!}
</div>
<label class="error" for-error="description"></label>
</div>
<div class="form-group">
@AnthonyMRodrigues
AnthonyMRodrigues / install-docker.sh
Created April 26, 2017 04:06 — forked from frgomes/install-docker.sh
Debian - install docker in Debian Jessie
#!/bin/bash
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install apt-transport-https ca-certificates -y
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D