Skip to content

Instantly share code, notes, and snippets.

phortuin /
Last active July 15, 2024 08:53
Set up a GPG key for signing Git commits on MacOS (M1)

Based on this blogpost.

To sign Git commits, you need a gpg key. GPG stands for GNU Privacy Guard and is the de facto implementation of the OpenPGP message format. PGP stands for ‘Pretty Good Privacy’ and is a standard to sign and encrypt messages.

Setting up

Install with Homebrew:

$ brew install gpg
phortuin /
Last active October 5, 2021 17:54
Set up mongo + database on MacOS (M1)

Based on these instructions.

Install with Homebrew:

$ brew tap mongodb/brew
$ brew install mongodb-community

Run server:

phortuin /
Last active June 16, 2024 09:36
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

phortuin /
Last active July 15, 2021 09:51
Brew/Appstore/MacOS update
# brew packages
$ brew update && brew outdated
$ brew upgrade && brew cleanup
# casks
$ brew upgrade --cask --greedy
# doctor
$ brew doctor
# App Store
$ mas upgrade
phortuin /
Last active May 24, 2023 07:55
Simple mobile menu

If you don’t run any other JavaScript on your site but need a mobile menu, this will do the trick. Simple media queries make sure the menu button shows up on large screens only, and the navigation menu is hidden from small screens. By progressively enhancing the nav element with a data-menu attribute, the button toggles visibility of the menu.


CSS: /styles.css

JS: /menu.js