This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## | |
## Create symlinks for a list of flatpaks that you want to be able to run | |
## from the terminal without typing `flatpak run herp.derp.derp.App` every | |
## time. | |
## | |
## Author: Kevin Ernst <[email protected]> | |
## Date: Some time in November, 2024 | |
## License: ISC or WTFPL, at your option | |
## Homepage: https://gist.github.com/ernstki/aae9e045369b48b517487c7e6694808d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name XHR Hook Example | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Hook into XHR requests | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
// source: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add link rel=next for "Thread Next" links | |
// @namespace https://github.com/ernstki | |
// @version 2024-11-13 | |
// @description For use with https://gitlab.com/arty.name/firefox-extension-find-next-page or similar | |
// @author Kevin Ernst (ernstki -at- mail.uc.edu) | |
// @match https://www.nntp.perl.org/* | |
// @icon https://icons.duckduckgo.com/ip4/perl.org.ico | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.12; | |
use Time::Piece; | |
sub isoize { | |
# convert any wacky date formats to ISO 8601 | |
my @dates; | |
foreach (@_) { | |
push @dates, Time::Piece->strptime($_, '%d %b %Y') if /\d+ \w+ \d{4}/; | |
# other date formats here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
button[data-testid="copy-contents-button"]::after { | |
content: "Copy contents"; | |
} | |
svg[data-testid="copy-to-clipboard-icon"] { | |
display: none; | |
} | |
a[aria-label="Open raw"]::after { | |
content: "Open raw"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## | |
## Trim extra pixels from around an image, e.g., a screenshot, and replace | |
## with a border of uniform width, of a color sampled from the four image | |
## corners, using ImageMagick 6.x (or above?) | |
## | |
## Author: Kevin Ernst <ernstki -at- mail.uc.edu> | |
## Date: 29 August 2024 | |
## License: WTFPL or ISC at your option | |
## Homepage: https://gist.github.com/ernstki/74aba058622a9cea43bebc4028aba5cd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TITLE = A Makefile that makes its own 'make help' target | |
ME = $(lastword $(MAKEFILE_LIST)) | |
HOMEPAGE = https://gist.github.com/ernstki/982edcfbf93c357bdb09878f7c724389/edit | |
help: # prints this help | |
@bash -c "$$AUTOGEN_HELP_BASH" < $(ME) | |
define AUTOGEN_HELP_BASH | |
declare -A targets; declare -a torder | |
targetre='^([A-Za-z]+):.* *# *(.*)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## | |
## Query a GitLab v4 API endpoint, with pagination | |
## | |
## Author: Kevin Ernst <ernstki -at- mail.uc.edu> | |
## License: ISC or WTFPL, at your discretion | |
## Date: 22 May 2024 | |
## Requires: jq (https://github.com/jqlang/jq) | |
## Homepage: https://gist.github.com/ernstki/3707675c8a4ddb06d128154947c49e29 | |
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pkgutil --packages \ | |
| if [[ "$1" ]]; then grep -i "$1"; else cat; fi \ | |
| perl -nE ' | |
#line 5 "pkgutil-list-files" | |
chomp; | |
print STDERR "# scanning $_…\n"; | |
$location = `pkgutil --pkg-info $_`; | |
$location =~ s/.*location: (.*?)\n.*/$1/s; | |
print STDERR "# location: $1\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## | |
## Accept arguments from popular package management tools (except Homebrew) | |
## and just do the right thing, based on the platform. | |
## | |
## Created out of frustration at typing `yum` on Macs and `port` on Linux | |
## boxes, and `apt` on RHEL/CentOS boxes all too often. | |
## | |
## Author: Kevin Ernst <ernstki -at- mail.uc.edu> | |
## Date: 16 Januar 2024 |
NewerOlder