Skip to content

Instantly share code, notes, and snippets.

View afonsoaugusto's full-sized avatar
👾
SRE & DevOps

Afonso Rodrigues afonsoaugusto

👾
SRE & DevOps
View GitHub Profile
  • Qual é o problema com a arquitetura das aplicações atuais?
  • Um projeto, na maioria das vezes, é começado pequeno, por uma pessoa e sem saber como será a sua evolução.
  • Pode acontecer de novas pessoas entrarem no projeto e não conhecerem as regras que guiam a aplicação.
  • Um dos princípios de organização é o MVC ou Model View Controller.
  • No MVC a regra de negócio fica na Model, os templates na View e a mediação é feita pelo Controller.
  • O MVC não é suficiente para manter uma aplicação com código compreensível durante muito tempo.
  • A ideia de utilizar MVC veio de frameworks e a maioria das aplicações estão acopladas de alguma maneira a frameworks.
  • Um projeto é iniciado normalmente (1) escolhendo um framework, (2) instalando um esqueleto, (3) removendo códigos de demonstração, (
@afonsoaugusto
afonsoaugusto / 01_execute_mongodb_with_database_files.sh
Last active August 26, 2020 13:00
Up mongodb with docker and files from backup.
tar -xvf archive.tar.gz
#Subir o banco no docker com bacup do Atlas:
docker run --rm -it -v $PWD:/data/db -p 27017:27017 mongo:3.6
docker run --rm -it -v $PWD:/data/db --memory="5g" --memory-swap="2g" --cpus="2.0" -p 27017:27017 mongo:3.6
import urllib3
import RPi.GPIO as gpio
import Adafruit_DHT as dht
import time as t
gpio.setmode(gpio.BOARD)
gpio.setup(32, gpio.OUT)
chave = 'TTN9Y84915G60MJY'
@tkaemming
tkaemming / example.py
Created March 8, 2012 01:25
python logging timer decorator
import logging, time
from timer import timed
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
logger.addHandler(handler)
@wagnerbianchijr
wagnerbianchijr / MAXSCALE_SETUP_RWSPLIT_MARIADBMON
Last active September 13, 2018 16:11
MaxScale 2.2.X setup (MariaDBMon+ReadWriteSplit Router)
#: This gist is supposed to be used when someone else intends to have a simple Maxscale 2.2.X++ setup
#: considering a replication cluster. By replication cluster I mean one master and X slaves; in the
#: case of this gist, I'm using just one slave, but, you can add as many as you want to add more to the
#: below gist. You will notice that Maxscale after setup will be configured using dynamic commands and
#: that is the place you will adjust your servers to be created an added to the service+monitor that
#: will be created. The service has a listener, here, allocated the mysql/3306 port.
###################### SETUP MARIADB OFFICIAL REPO AND MAXSCALE PACKAGES ######################
#: executing the command for the repository setup on servers