Skip to content

Instantly share code, notes, and snippets.

@crazygolem
crazygolem / remove-w3schools-from-google-search.user.js
Last active August 29, 2015 14:26 — forked from kelunik/remove-w3schools-from-google-search.user.js
Remove w3schools.com from Google Search results
// ==UserScript==
// @name Ditch W3Schools
// @namespace pwa.lu
// @description Remove w3schools.com results from Google
// @include http://www.google.tld/*
// @include https://www.google.tld/*
// @version 1.0
// @grant none
// ==/UserScript==
//
@crazygolem
crazygolem / mpv-gnome-inhibit.lua
Last active May 6, 2024 18:07
Prevent the screen from blanking under GNOME+Wayland while a video is playing
--[[
Prevent the screen from blanking while a video is playing.
This script is a workaround for the GNOME+Wayland issue documented in the
[Disabling Screensaver] section of the mpv manual, and depends on
gnome-session-inhibit (usually provided by the gnome-session package) to set up
the inhibitors.
@crazygolem
crazygolem / utils.jq
Last active August 27, 2022 00:29
Utility functions for jq, to copy-paste into your scripts or extract and include as module
# Dynamically parses a string into a PATHS array, typically to use with the
# builtins `getpath/1`, `setpath/2` and `delpaths/1`.
#
# This is similar to the native function `path/1` for exact match path
# expressions, but takes the path as a string instead of an actual path, which
# allows to parse it at runtime. This can be useful for working with paths that
# you get from your data, or passing paths from a shell script safely (until a
# more powerful `eval` builtin gets implemented, see [jq#384]),
# e.g.:
#
@crazygolem
crazygolem / kdocker-launch
Created March 23, 2023 09:14
Launch an application with KDocker from its desktop file.
#!/usr/bin/env python3
import argparse
import os
import re
import shlex
import shutil
import subprocess
# pyxdg; https://freedesktop.org/wiki/Software/pyxdg/