This file contains hidden or 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
axios.interceptors.request.use(async (config) => { | |
if ( | |
!config.url.endsWith('login') || | |
!config.url.endsWith('refresh') || | |
!config.url.endsWith('signup') | |
) { | |
const userTokenExpiration = new Date(await AsyncStorage.getItem('userTokenExpiration')); | |
const today = new Date(); | |
if (today > userTokenExpiration) { | |
// refresh the token here |
This file contains hidden or 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
import smtplib | |
smtp_server = smtplib.SMTP('smtp.gmail.com', 587) | |
smtp_server.ehlo() | |
smtp_server.starttls() | |
smtp_server.login('[email protected]', '<App Password>') | |
smtp_server.sendmail('[email protected]', '[email protected]', 'Subject: Happy Australia Day!\nHi Everyone! Happy Australia Day! Cheers, Julian') | |
smtp_server.quit() |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-get install \ | |
linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual |
This file contains hidden or 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
sudo apt-get remove docker docker-engine |
This file contains hidden or 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
# Cria um venv com uma versão específica do python | |
mkvirtualenv flask --python=python3 | |
# Cria um venv com um módulo pré-instalado | |
mkvirtualenv flask --python=python3 -i flask | |
# Remove um venv | |
mkvirtualenv flask | |
This file contains hidden or 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
source ~/.bashrc | |
mkdir -p $WORKON_HOME | |
# Se estiver usando o zsh | |
# source ~/.zshrc |
This file contains hidden or 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
sudo nano ~/.bashrc |
This file contains hidden or 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
# virtualenvwrapper | |
# Diretório onde os ambientes virtuais serão armazenados | |
export WORKON_HOME=$HOME/.virtualenvs | |
# Adicionamos os comandos virtualenvwrapper no bash | |
source ~/.local/bin/virtualenvwrapper.sh |
This file contains hidden or 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
sudo apt install python3-pip python-dev build-essential | |
sudo pip3 install virtualenv virtualenvwrapper |
This file contains hidden or 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 flask import Flask | |
meu_web_app = Flask('meu_web_app') | |
@meu_web_app.route('/') | |
def pagina_inicial(): | |
return "ok" | |