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
""" | |
Finding the solution for x ^ (x + 1) = (x + 1) ^ x | |
python main.py m start stop step dps | |
pip install matplotlib mpmath numpy sympy | |
Supposed truth values: | |
2.271823903 | |
2.293053068 |
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
""" | |
Fibonacci Word Fractal Colorized | |
Public Domain Fibonacci Day (November 23) 2022 | |
Copy pasted and adapted from these sources: | |
https://rosettacode.org/wiki/Fibonacci_word/fractal#Python | |
https://python-forum.io/thread-25822.html | |
https://github.com/francofgp/dragon-curve | |
https://stackoverflow.com/questions/35629520/ | |
https://stackoverflow.com/questions/73388248/ |
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
"""Arquivo de configuração""" | |
attr: str = "Original" | |
def func(n: int) -> int: | |
"""Multiplica um número natural por 3""" | |
return n * 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
## https://mcsp.wartburg.edu/zelle/python/graphics.py | |
from graphics import * | |
import random | |
import time | |
# configurations | |
WIDTH = 1000 | |
GRID_HEIGHT = WIDTH | |
HEIGHT = 470 |
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
<!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> |
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
## 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, |
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/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 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 | |
## 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" |
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
## 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': { |
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 | |
## 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 |