Skip to content

Instantly share code, notes, and snippets.

@bernhardfritz
bernhardfritz / 0-macbook-friendly-ubuntu-tweaks.md
Last active July 27, 2026 12:44
MacBook-friendly Ubuntu tweaks

MacBook-friendly Ubuntu tweaks

I recently decided to switch from macOS BigSur 11.7.10 to Ubuntu 24.04 LTS after Apple decided to no longer provide updates for my MacBook Pro 11,1. During this transition I learned about various tweaks to improve user experience for MacBook users.

As a MacBook user you are probably used to keyboard shortcuts involving the ⌘ command key like ⌘ command+C and ⌘ command+V to copy/paste respectively. However, in Ubuntu pressing the ⌘ command key by default will open the Activities Overview which is similar to the Exposé view in macOS which is not what we want. As it turns out, Ubuntu involves the control key for almost all combinations you may be used to that involve the ⌘ command key in macOS. Luckily Ubuntu is quite configurable and we can tailor it to our needs.

Prerequisites

@rutcreate
rutcreate / README.md
Last active April 26, 2026 10:12
Install Python 3.10.x on Ubuntu 20.04

Prerequisite

sudo apt update
sudo apt install software-properties-common -y

Add custom APT repository

@lmn3x
lmn3x / code_meli_validator.py
Last active August 23, 2023 05:45
django validator for code meli
from django.core.exceptions import ValidationError
def validate_meli_code(value: str):
if not len(value) == 10:
raise ValidationError("کد ملی باید ۱۰ رقم باشد.")
res = 0
for i, num in enumerate(value[:-1]):
res = res + (int(num) * (10 - i))
@alejovicu
alejovicu / python3.7.2-selenium-alpine3.8-dockerfile
Last active August 23, 2023 04:16
Docker Selenium Webdriver with Python3 in alpine 3.8
# Objective: Running selenium python scripts in alpine without grid
FROM python:3.7.2-alpine3.8
RUN pip install selenium
RUN apk add chromium
RUN apk add chromium-chromedriver
ENV CHROME_BIN=/usr/bin/chromium-browser \
@vitorfs
vitorfs / example.html
Last active October 22, 2024 17:00
Startswith Template Filter
{% load startswith %}
<li{% if request.path|startswith:'/settings/' %} class="active"{% endif %}>
@senko
senko / singleton.py
Created February 25, 2013 08:01
Singleton Django Model
# Written by Senko Rasic <senko.rasic@goodcode.io>
# Released into Public Domain. Use it as you like.
from django.db import models
class SingletonModel(models.Model):
"""Singleton Django Model
Ensures there's always only one entry in the database, and can fix the