I hereby claim:
- I am desci on github.
- I am iuriguilherme (https://keybase.io/iuriguilherme) on keybase.
- I have a public key whose fingerprint is BE63 A69B 71FA 985A 2384 24DD E23E 7EC0 76CB DC46
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env python | |
| ## FastAPI is a great tool for... fast APIs... but there are better | |
| ## solutions for web apps such as Django, Web2Py and Flask. Talking | |
| ## about Flask, there is the Quart project which aims to be the full | |
| ## async version of Flask that you can use today. | |
| ## | |
| ## I have read the following documentation to reach the result of this | |
| ## gist: | |
| ## | |
| ## * <https://fastapi.tiangolo.com/tutorial/middleware/> |
I hereby claim:
To claim this, I am signing this object:
| #!/bin/bash | |
| if [ ! -z $2 ] | |
| then | |
| SOURCE_PATH="$(dirname $1)" | |
| SOURCE_DIR="$(basename $1)" | |
| DEST_PATH="$(dirname $2)" | |
| DEST_FILE="$(basename $2).tar.xz" | |
| XZ_OPT=-e9 ionice -c 2 -n 7 nice -n 19 tar -cJhvpnS -C "${SOURCE_PATH}" \ | |
| "${SOURCE_DIR}" -f "${DEST_PATH}/${DEST_FILE}" |
| #!/bin/bash | |
| ## This script will move safely all files and folders in the arguments list to the last argument. It uses rsync so it can be sent to remote servers. | |
| rsync -avvhSP --remove-source-files "$@" | |
| for DIR in "${@}" | |
| do | |
| ## like `rmdir` but recursively for every argument (only removes empty directories) | |
| find "${DIR}" -type d -empty -delete | |
| done |
| ## Dump all git repositories from selected users. In this example notabug.org and github.com are used | |
| ## Change the dictionary "repos" to your own data | |
| ## Needs https://gitpython.readthedocs.io/ | |
| ## pip install GitPython | |
| import git, logging, os | |
| from git import Git, Repo, Remote, RemoteProgress | |
| repos = { | |
| 'notabug': { |
| #!/bin/bash | |
| ## Backup incremental do banco de dados do wordpress | |
| ## Precisa de mysqldump e rdiff-backup | |
| ## Pronto pra rodar com crontab | |
| ## Mantém arquivos temporários com alta compressão em /tmp/backups | |
| ## Usa arquivo de configuração do wordpress para pegar os dados do mysql opcionalmente | |
| NOW="$(date +%s)" | |
| SITE="wordpress" |
| #!/bin/env python | |
| import datetime, glob, os, sys | |
| try: | |
| ## Default to pwd | |
| root = './' | |
| ## For python files in the current folder (and subfolders recursively) this would be `filesystem_watch.py './' '/*.py'` | |
| pattern = '' |
| ## This code makes a web form to send messages to telegram users | |
| ## pip install aiogram quart flask-wtf | |
| ## QUART_APP=app:app quart run | |
| import logging | |
| logger = logging.getLogger(__name__) | |
| import asyncio, secrets | |
| from aiogram import ( | |
| Bot, |
| <!DOCTYPE html> | |
| <html lang = "en"> | |
| <head> | |
| <!-- | |
| This is mandatory for latin characters, because there's just no standard | |
| in web browsers, and probably there'll never be | |
| --> | |
| <meta charset = "utf-8" /> | |
| <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
| <script defer src="https://pyscript.net/alpha/pyscript.js"></script> |