Skip to content

Instantly share code, notes, and snippets.

View rougeth's full-sized avatar

Marco Rougeth rougeth

View GitHub Profile
@rougeth
rougeth / apyb-cofre.sh
Created March 23, 2023 21:44
Comandos para atualizar o repositório do cofre da APyB
export APYB_COFRE_PATH=/caminho/do/repositorio
function apyb-pull() {
# Obtém o caminho do repositório local da variável de ambiente
local repo=${APYB_COFRE_PATH:?Erro: o caminho do repositório não foi definido na variável de ambiente APYB_COFRE_PATH}
[[ -d "$repo" ]] || { echo "Erro: o caminho do repositório não existe."; return 1; }
cd "$repo"
# Verifica se há arquivos não commitados. Atenção para não perder dados em caso de conflito.
[[ -z $(git status --porcelain) ]] || { echo "Erro: há arquivos não commitados no repositório local."; return 1; }
import sys
import toml
from slugify import slugify
def load_config_file():
try:
path = sys.argv[1]
except IndexError:
@rougeth
rougeth / pyne.py
Created August 1, 2021 18:54
Robô da Python Nordeste 2020/2021
import discord
from discord.ext import commands
from decouple import config
DISCORD_TOKEN = config("DISCORD_TOKEN")
bot = commands.Bot(command_prefix="pyne!", intents=discord.Intents.default())
function cut_and_concat ()
{
SOURCE=$PWD/$1
OUTPUT=$PWD/$2
OPENING=$PWD/$3
START_AT=$4
END_AT=$5
TIMESTAMP=$(date +"%Y%m%d%H%M%S")
@rougeth
rougeth / README.md
Last active May 14, 2022 02:55
Script para gerar os certificados da Python Brasil
@rougeth
rougeth / pybr20-foto-oficial.py
Created November 8, 2020 21:06
Script gerador da foto oficial da Python Brasil 2020
import asyncio
import sys
from pathlib import Path
import discord
from PIL import Image
def gerar_imagem():
imagens = [
@rougeth
rougeth / async_rotina.py
Created April 21, 2018 20:07
Async que se faz - TDC 2018
# Código usado na palestra "Async que se faz - asyncio na prática"
# no TDC 2018 em Florianópolis
# Creative Commons Attribution 4.0 International license <https://creativecommons.org/licenses/by/4.0/>
import asyncio
import random
from time import sleep
from utils import UPDATE_AVG, async_request, timeit
@rougeth
rougeth / utils.py
Created April 21, 2018 20:07
Async que se faz - TDC 2018
# Código usado na palestra "Async que se faz - asyncio na prática"
# no TDC 2018 em Florianópolis
# Creative Commons Attribution 4.0 International license <https://creativecommons.org/licenses/by/4.0/>
# requirements: termcolor
import random
import asyncio
from asyncio import sleep as async_sleep
from time import time, sleep as sync_sleep
@rougeth
rougeth / sync_rotina.py
Created April 21, 2018 20:06
Async que se faz - TDC 2018
# Código usado na palestra "Async que se faz - asyncio na prática"
# no TDC 2018 em Florianópolis
# Creative Commons Attribution 4.0 International license <https://creativecommons.org/licenses/by/4.0/>
import random
from time import sleep
from utils import UPDATE_AVG, sync_request
def hello_world():
print('hello world')
hello_world()
if __name__ == '__main__':
print('dentro do if')
hello_world()