Skip to content

Instantly share code, notes, and snippets.

View bernhardfritz's full-sized avatar

Bernhard Fritz bernhardfritz

View GitHub Profile
import p8g, {
background,
createCanvas,
rect,
random,
} from 'https://unpkg.com/p8g.js';
p8g.draw = () => {
// background(220);
rect(150, 50, 100, 100);
@bernhardfritz
bernhardfritz / 0-macbook-friendly-ubuntu-tweaks.md
Last active August 1, 2025 06:14
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

import p8g, {
background,
createCanvas,
line,
} from 'https://unpkg.com/p8g.js';
const p0 = [50, 50];
const p1 = [300, 100];
const p2 = [200, 300];
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const partition = (a, lo, hi) => {
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const iParent = (i) => Math.floor((i - 1) / 2);
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const merge = (left, right) => {
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const gaps = [701, 301, 132, 57, 23, 10, 4, 1];
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const insertionSort = (a) => {
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const selectionSort = (a) => {
import p8g, {
background,
createCanvas,
height,
line,
noSmooth,
random,
} from 'https://unpkg.com/p8g.js';
const bubbleSort = (a) => {