Skip to content

Instantly share code, notes, and snippets.

View viktorvillalobos's full-sized avatar
🏠
Working from home

Víctor Villalobos viktorvillalobos

🏠
Working from home
View GitHub Profile
@viktorvillalobos
viktorvillalobos / ubuntu-20.04-macbook-pro.md
Created November 20, 2024 21:57 — forked from johnjeffers/ubuntu-20.04-macbook-pro.md
Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

Ubuntu 20.04 on a 15" Retina MacBook Pro (Mid-2014)

These are notes from my efforts to get Ubuntu 20.04 installed on my older MacBook Pro. I'm making this gist public in the hopes that it's helpful to others.

I did a Minimal install, but selected the option to install additional 3rd-party drivers.

Wifi doesn't work during the install (because it requires a 3rd-party driver), so you won't be able to choose to download updates while installing. No big deal, run a software update after the install.

The installer takes about 25 minutes to complete. Post-install, most things work. The only driver I had to manually install was for the FaceTime camera. More on that below.

@viktorvillalobos
viktorvillalobos / chunks_generators.py
Created November 2, 2020 22:02
Generate chunks using python generators.
# based on: https://stackoverflow.com/questions/24527006/split-a-generator-into-chunks-without-pre-walking-it
def chunks(iterable, size=10):
iterator = iter(iterable)
for first in iterator:
yield chain([first], islice(iterator, size - 1))
@viktorvillalobos
viktorvillalobos / django_filter_queryset_entities_proposal.py
Last active October 22, 2020 16:07
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:
self.name = name
self.age = age
@viktorvillalobos
viktorvillalobos / class_selenium_scraper.py
Created August 3, 2018 18:13
Selenium scraping class with chrome and headless mode.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class WebDriver:
DOWNLOAD_DIR = '/tmp'
def __init__(self, headless=True):
self.options = webdriver.ChromeOptions()
@viktorvillalobos
viktorvillalobos / setup.py
Created September 25, 2015 01:16
setup.py cx_freeze + Python3.4 + PyQt5 + Requests
from cx_Freeze import setup, Executable
import requests.certs
build_exe_options = \
{"include_files":[
(requests.certs.where(),'cacert.pem'),
('config.ini'),
('input/'),
('output/')
]}