Skip to content

Instantly share code, notes, and snippets.

View idleberg's full-sized avatar

Jan T. Sott idleberg

View GitHub Profile
@idleberg
idleberg / reinstall-nix-error.md
Last active October 6, 2025 12:21
Nix Reinstallation Error

When trying to reinstall Nix using the official installer, you might run into the following error (the UID might vary)

---- oh no! --------------------------------------------------------------------
It seems the build group nixbld already exists, but
with the UID 30000. This script can't really handle
that right now, so I'm going to give up.

You can export NIX_BUILD_GROUP_ID=30000 and re-run.
@idleberg
idleberg / Restore Mac using DFU mode.md
Last active July 21, 2025 14:31
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 / shell.nix
Last active October 25, 2024 12:13
My Nix Shell configuration for NodeJS development
{
pkgs ? import <nixpkgs> {
config = {
allowUnfree = true;
};
},
}:
pkgs.mkShell {
packages = with pkgs; [
@idleberg
idleberg / my-git-aliases.md
Last active June 8, 2024 15:55
my-git-aliases.md

The Git documentation lists some fairly common aliases:

git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

Here are some of my personal ones:

@idleberg
idleberg / discord.md
Last active September 9, 2023 08:36
Hide blocked users on Discord

Hide blocked users on Discord

When you block a user on Discord, you still get an option to show the user's messages. This can defeat the purpose of blocking, it can be bad for your health.

The following CSS snippet will hide a blocked user's messages for good. It can be used with Stylish or any other extension that allows override a website's style.

[class^="groupStart"]:has([class^="blockedSystemMessage"]) {
  display: none;
}
@idleberg
idleberg / MastodonIFTTT.md
Last active March 28, 2025 08:28
Connecting IFTTT with Mastodon

Important

IFTTT now has official support for Mastodon, so following this guide is no longer necessary!

Connecting IFTTT with Mastodon

As of the time of this writing, IFTTT has no integration for Mastodon. Yet, it's possible to connect the two.

Mastodon

  1. Login to your Mastodon account
@idleberg
idleberg / macports_permissions.md
Last active November 4, 2025 00:35
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 / playdate-sdk.md
Last active November 23, 2024 21:06
Install Playdate SDK using a package manager

Install Playdate SDK

If you're like me, you want to install the Playdate SDK using a package manager. Below are some options for you.

Info Did I miss anything? Please comment below!

macOS

@idleberg
idleberg / vscode-macos-context-menu.md
Last active November 9, 2025 09:42
“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 / rle_dec.lua
Last active September 8, 2022 09:33
RLE decoder that supports Pico-8's subset of Lua
-- Helper function to repeat string
function rep(char, multiplier)
local out = ""
for i=1, multiplier do
out = out..char
end
return out
end