Skip to content

Instantly share code, notes, and snippets.

View FernandoCelmer's full-sized avatar

Fernando Celmer FernandoCelmer

View GitHub Profile
"""ZeroMQ module"""
import asyncio
from typing import Callable
from zmq import Context as ContextClient, PUSH, PULL, POLLIN # type: ignore
from zmq.asyncio import Context as ContextServer, Poller # type: ignore
from dotflow.abc.tcp import TCPClient, TCPServer
import time
dots = ["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]
for dot in dots:
time.sleep(0.1)
print(f"\r{dot} Working on task...", end="", flush=True)
def retry(max_retry):
def inside(func):
def wrapper(*args, **kwargs):
attempt = 0
error_output = None
while max_retry > attempt:
try:
return func(*args, **kwargs)
except Exception as error:
package main
import (
"encoding/json"
"fmt"
"io"
"net/http"
"sync"
)
@FernandoCelmer
FernandoCelmer / test.py
Created November 16, 2023 16:40
test.py
import pytest
from sqlalchemy import create_engine, Column, Integer, String, DateTime, Text, ForeignKey
from sqlalchemy.engine import URL
from sqlalchemy.orm import declarative_base, relationship, sessionmaker
from datetime import datetime
from sqlalchemy.exc import IntegrityError
Base = declarative_base()
@FernandoCelmer
FernandoCelmer / scrapping.py
Created November 10, 2023 20:22
scrapping.py
"""
pip install selenium
pip install webdriver-manager
python scrapping.py
"""
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
{
"package": {
"docker": [
{
"id": "9B163E4B325C46AD9A169C4B98E4275B",
"tag": "docker",
"type": "brew",
"name": "docker",
"url": null,
"file": null,
class Model:
def __init__(self, config: dict) -> None:
self.config = config
class Producer:
def __new__(cls, config: dict, debug: bool):
if debug:
pkgbase = linux-profile
pkgdesc = 🐧 Linux Profile Management CLI Tool
pkgver = 1.0.19
pkgrel = 1
url = https://github.com/linux-profile/linux-profile
arch = any
license = MIT
makedepends = python-docutils
makedepends = python-setuptools
depends = python
# Maintainer: Fernando Celmer <email@fernandocelmer.com>
pkgname=linux-profile
pkgver="1.0.19"
pkgrel=1
pkgdesc="🐧 Linux Profile Management CLI Tool"
arch=('any')
url="https://github.com/linux-profile/linux-profile"
license=('MIT')
depends=('python')