Skip to content

Instantly share code, notes, and snippets.

Working from home

Victor H. Villalobos B. viktorvillalobos

Working from home
View GitHub Profile
viktorvillalobos /
Created Nov 2, 2020
Generate chunks using python generators.
# based on:
def chunks(iterable, size=10):
iterator = iter(iterable)
for first in iterator:
yield chain([first], islice(iterator, size - 1))
viktorvillalobos /
Last active Oct 22, 2020
Data Classes for Django QuerySet filters and exclutions proposal
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
class Model:
def __init__(self, name: str, age: int) -> None: = name
self.age = age
viktorvillalobos /
Created Aug 3, 2018
Selenium scraping class with chrome and headless mode.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class WebDriver:
def __init__(self, headless=True):
self.options = webdriver.ChromeOptions()
viktorvillalobos /
Created Sep 25, 2015 cx_freeze + Python3.4 + PyQt5 + Requests
from cx_Freeze import setup, Executable
import requests.certs
build_exe_options = \
You can’t perform that action at this time.