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 March 14, 2024 02:55
“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 / sublime-chmod.py
Last active February 24, 2024 02:17
Make files of Sublime Text package executable, runs on installation/upgrade
# https://gist.github.com/idleberg/03bc3766c760bb4b81e3
import os, stat, sublime, sublime_plugin
# Array of files, relative to package directory
files = [
'my-script.sh'
]
def plugin_loaded():
@idleberg
idleberg / sublime-text-macos-context-menu.md
Last active February 20, 2024 09:37 — 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
@idleberg
idleberg / my-git-aliases.md
Last active February 14, 2024 12:06
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 / fish_shell.md
Last active January 16, 2024 21:57
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 / scoop.md
Last active November 29, 2023 05:43
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 November 19, 2023 12:40
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 / macports_permissions.md
Last active October 16, 2023 13:04
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 September 27, 2023 17:37
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 / 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;
}