Skip to content

Instantly share code, notes, and snippets.

View hammerill's full-sized avatar
🚘
learns his new car

Hammerill hammerill

🚘
learns his new car
View GitHub Profile
@hammerill
hammerill / mpv-config.md
Last active December 27, 2025 13:39
mpv Config

mpv Config

Linux & macOS

~/.config/mpv/mpv.conf:

# Avoid creating a window larger than the screen
autofit-larger=80%x80%
@hammerill
hammerill / pandoc-docker.md
Last active July 15, 2025 14:33
Pandoc Docker

Pandoc Docker

Instead of installing Pandoc directly on your machine (and possibly signing a contract to clean the ass of all its haskell dependencies) you can just use it with a Docker run script (accessible as pandoc from all the scripts).

~/.local/bin/pandoc:

#!/bin/bash

docker run --rm -v "$(pwd):/data:z" -u "$(id -u)":"$(id -g)" pandoc/extra "$@"
@hammerill
hammerill / chrome-open-in-mpv.md
Last active January 20, 2026 22:20
Chrome "Open in mpv"

Chrome "Open in mpv"

This is a detailed guide of adding a "Open in mpv" option to your right-click menu in Google Chrome (and potentially all Chromium-based browsers).

Prerequisites

  • The mpv player itself.
  • yt-dlp.
  • python3.
@hammerill
hammerill / tmux-config.md
Last active December 2, 2025 15:32
tmux Config

tmux Config

echo -e 'set -g status-bg black\nset -g status-fg white\n\nset -g base-index 1\nsetw -g pane-base-index 1\n\nset -g mouse on\nset -s set-clipboard on' > ~/.tmux.conf

FFmpeg Convert 1.jpg to .jpg

for file in *1.jpg; do ffmpeg -i "$file" "${file%1.jpg}".jpg && rm "$file"; done

Unified Copy

Warning

Now it's suggested to install this CLI tool with this GitHub repo and not this Gist. I'll leave it here for archiving reasons.

Sometimes it's not easy to get things from a terminal to your system clipboard. If you're connected locally, it has to be a special tool which handles this (like wl-clipboard under Wayland) or something other when connected remotely.

This is a Shell executable which ultimately solves the problem by always reaching your local system clipboard:

Sunshine Lock Systemd Entry

/etc/systemd/user/sunshine-lock.service:

[Unit]
Description=Lock Screen When Sunshine Loaded
After=sunshine.service

[Service]

Arch Linux Printer

sudo pacman -S --needed cups system-config-printer
sudo systemctl enable cups --now

system-config-printer
@hammerill
hammerill / vimrc.md
Last active June 23, 2025 12:28
Define Vim Config

Define Vim Config

VIMRC_PATH=/etc/vimrc # Adjust the path (differs in various distribs)

echo -e '\nset shiftwidth=4\nset smarttab\n\nsyntax on' | sudo tee -a "$VIMRC_PATH"

Force Command+Number Shortcuts for Tabs in VS Code for macOS

Keyboard Shortcuts.

{ "key": "cmd+1","command": "workbench.action.openEditorAtIndex1" },
{ "key": "cmd+2","command": "workbench.action.openEditorAtIndex2" },
{ "key": "cmd+3","command": "workbench.action.openEditorAtIndex3" },
{ "key": "cmd+4","command": "workbench.action.openEditorAtIndex4" },
{ "key": "cmd+5","command": "workbench.action.openEditorAtIndex5" },