Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando Celmer FernandoCelmer

View GitHub Profile
View Dockerfile.archlinux
FROM archlinux:base-devel
RUN useradd -m build && \
pacman -Syu --noconfirm && \
pacman -Sy --noconfirm git && \
echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build
USER build
WORKDIR /home/build
View script_commit_branch.py
import os
pattern = [
"⚙️ FEATURE",
"📝 PEP8",
"📌 ISSUE",
"🪲 BUG",
"📘 DOCS",
"📦 PyPI",
"❤️️ TEST",
View scrapy.py
import scrapy
class BlogSpider(scrapy.Spider):
name = 'blogspider'
start_urls = ['https://www.zyte.com/blog/']
def parse(self, response):
for title in response.css('.oxy-post-title'):
yield {'title': title.css('::text').get()}
View pyramid.py
def pyramid(scale: int):
node = []
for index in range(1, scale + 1):
node.append((index*2-scale)*"*") if (index*2-scale) > 0 else None
for item in node:
print(item.center(scale))
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Todo App</title>
<link rel="icon" type="image/png" href="favicon.png" />
View pip_search.py
"""
selenium==4.6.0
webdriver-manager==3.8.4
packaging==21.3
"""
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
View load_settings.py
settings_module = __import__("settings.development", globals(), fromlist=[None], level=0)
for settings in dir(settings_module):
if not (settings.startswith('_') or settings.endswith('_')):
globals()[settings] = getattr(settings_module, settings)
View logger.py
def logger(function):
def wrapper(*args, **kwargs):
print(f"----- {function.__name__}: start -----")
output = function(*args, **kwargs)
print(f"----- {function.__name__}: end -----")
return output
return wrapper
View request.py
from json import dumps
from urllib import parse
from http.client import HTTPSConnection
class Request:
def __init__(self, url: str = '127.0.0.1') -> None:
self.url = url
self.local = None