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: WTFPL | |
## 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 |
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/bash | |
## | |
## Simple wrapper script for Apache tika | |
## | |
## Usage: download the latest `tika-app*.jar` from [1] to your ~/bin | |
## and copy this script alongside. Make executable with | |
## | |
## chmod a+x ~/bin/tika` | |
## | |
## Test with `tika --help`. |
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 | |
## | |
## Usage: fc-reject.pl > ~/.config/fontconfig/conf.d/88-reject.conf | |
## Author: Kevin Ernst <ernstki -at- mail.uc.edu> | |
## License: MIT or CC-BY-SA-4.0, at your option | |
## Source: https://gist.github.com/ernstki/2ae279ad89888e4099c9852bf0ba5d11 | |
## | |
use v5.12; | |
use warnings; | |
use autodie; |
NewerOlder