Skip to content

Instantly share code, notes, and snippets.

View idleberg's full-sized avatar

Jan T. Sott idleberg

View GitHub Profile
@idleberg
idleberg / vscode-macos-context-menu.md
Last active August 5, 2026 21:14
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@idleberg
idleberg / Install-Mcrypt.md
Last active June 18, 2026 08:09
Install Mcrypt on macOS

Setup php-mcrypt on macOS (and versions of Mac OS X)

Important

I haven't been using PHP for many years, so I have no intention of updating this gist. Hopefully, the process is still the same for newer versions PHP, but I'm the wrong person to ask this. Feel free to comment though!

These steps should have been mentioned in the prerequisites of the Laravel Installation Guide, since I'm surely not the only person trying to get Laravel running on macOS.

Install

Install Mcrypt using Homebrew and PECL (comes with PHP)

@idleberg
idleberg / macports_permissions.md
Last active June 17, 2026 14:03
Fixing permissions for MacPorts local repositories

Permissions for local MacPorts repositories

Getting local Portfile repository for MacPorts running is difficult, if not annoying. The documentation doesn't provide much help or, worse, is even outdated. Hopefully, the following steps will help avoiding the problem I had.

Installation

  1. Download and run the MacPorts installer

  2. Unlike specified in the documentation, the installer did not add /opt/local/bin to my PATH environmental variable. However, since I don't use the default macOS shell, the problem might actually be on my end.

@idleberg
idleberg / migration.md
Last active June 13, 2026 12:13
Move repository into a monorepo

This is a guide on how you can move a repository into an existing monorepo while keeping the entire history.

1. Add remote

First, let's define some variables:

REPO_ORIGIN=github.com
REPO_USER=idleberg
REPO_NAME=demo
@idleberg
idleberg / Restore Mac using DFU mode.md
Last active May 28, 2026 16:50
Restore Mac using DFU mode

Note

If you followed this guide before, you might want to scroll all the way down to the TL;DR version of this guide

Intro

Somehow, I managed to ”brick“ my Mac mini (2018, Intel) when I wiped its data before selling it online. From then on I could no longer:

  • boot the normal Recovery Mode
  • re-install macOS using an USB stick
  • use the online Recovery Mode, since it always ended up in a error -1008F
@idleberg
idleberg / Brewfile
Last active May 28, 2026 14:46
Personal Brewfile
# idleberg/asahi
tap "idleberg/asahi"
cask "idleberg/asahi/ardent"
cask "idleberg/asahi/io"
cask "idleberg/asahi/cleansi"
brew "idleberg/asahi/hashman"
brew "idleberg/asahi/krampus"
# Development
brew "act"
@idleberg
idleberg / scoop.md
Last active March 11, 2026 09:08
Scoop Aliases

Common aliases for the scoop package manager

# Install app
scoop alias add i 'scoop install $args[0]' 'Install app'
scoop alias add add 'scoop install $args[0]' 'Install app'

# Uninstall app
scoop alias add rm 'scoop uninstall $args[0]' 'Uninstall an app'
scoop alias add remove 'scoop uninstall $args[0]' 'Uninstall an app'
@idleberg
idleberg / vscode-theme-colors.jsonc
Last active February 5, 2026 10:56
VSCode Theme Colors
{
"colors": {
// An extra border around active elements to separate them from others for greater contrast.
"contrastActiveBorder": "",
// An extra border around elements to separate them from others for greater contrast.
"contrastBorder": "",
//Overall border color for focused elements. This color is only used if not overridden by a component.
"focusBorder": "",
//Overall foreground color. This color is only used if not overridden by a component.
@idleberg
idleberg / fish_shell.md
Last active January 24, 2026 21:18
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active December 25, 2025 16:01 — forked from vincentmac/sublime-text-osx-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments