Skip to content

Instantly share code, notes, and snippets.

View robin-a-meade's full-sized avatar

Robin A. Meade robin-a-meade

View GitHub Profile
@robin-a-meade
robin-a-meade / deps_to_classpath
Last active March 30, 2024 19:49
resolve dependencies and print classpath. This is a wrapper around `jbang info classpath`.
#!/bin/bash
# NAME
# deps_to_classpath - resolve dependencies and print classpath
#
# SYNOPSIS
# deps_to_classpath [OPTIONS] DEP...
#
# EXAMPLE
# Suppose you are evaluating different HTML parsers to use with saxon. You
@robin-a-meade
robin-a-meade / versions-maven-plugin ignore versions.md
Last active November 8, 2024 18:34
versions-maven-plugin How to ignore alpha beta release candidate and milestone versions

versions-maven-plugin: How to ignore alpha, beta, release candidate, and milestone versions

Introduction

The versions-maven-plugin, by default, does not ignore versions ending with qualifier strings when searching for the latest version of an artifact.

For example, versions ending with -alpha.14, -beta3, -M-2, and -RC1 will be considered as valid upgrade candidates.

Suppose your project depends on version 3.2.1 of a certain artifact and then 3.3.0-beta is released. The versions-maven-plugin will, by default, consider that to be a valid upgrade.

@robin-a-meade
robin-a-meade / Sample output
Created April 9, 2023 06:34
Check the gnome extension packages in the Fedora repo for any that are not compatible with the currently running version of Gnome
Checking for existence of jq command ..... Y
Checking for existence of rpm2cpio command ..... Y
Checking for existence of cpio command ..... Y
You are running Fedora 38
You are running Gnome 44
There are 43 packages matching the pattern 'gnome-shell-extension-*'
1 gnome-shell-extension-appindicator-0:53-1.fc38.noarch
2 gnome-shell-extension-apps-menu-0:44.0-1.fc38.noarch
3 gnome-shell-extension-argos-0:3^20220712git1180568-2.fc38.noarch
4 gnome-shell-extension-auto-move-windows-0:44.0-1.fc38.noarch
@robin-a-meade
robin-a-meade / .gitignore
Last active November 15, 2022 09:53
Webpack detects ESM modules automatically
/main.js
/node_modules
/package-lock.json
@robin-a-meade
robin-a-meade / README.md
Last active August 21, 2022 04:05
How to use ESM modules with NodeJS

How to use ESM modules with NodeJS

Excerise 1: Clone the gist and run the examples

  1. Create a temporary directory and cd into it
  2. Clone the gist
  3. Run the examples
cd "$(mktemp -d)"
git clone [email protected]:4ba7867a771de384b66b512d1847de61.git .
@robin-a-meade
robin-a-meade / sdl2hello.cc
Last active August 14, 2022 01:49 — forked from fschr/main.cpp
SDL2 Hello World | SDL2 Getting Started | SDL | OpenGL
// SDL2 Hello, World!
// This should display a white screen for 2 seconds
// with the text 'Hello World!'
// Prerequisites (Fedora):
// sudo dnf install SDL2-static
// sudo dnf install SDL2-devel (Actually, this gets installed as a dependency of SDL2-static)
// sudo dnf install SDL2_ttf-devel
// Compile:
// gcc -g sdl2hello.cc -o sdl2hello -lSDL2 -lSDL2main -lSDL2_ttf
// Run:
@robin-a-meade
robin-a-meade / lipsum
Last active July 1, 2022 21:18 — forked from candu/lipsum
Command-line Lorem Ipsum generator using curl, lipsum.com, and jq
#!/bin/sh
AMOUNT=5
WHAT=paras
START=false
MARKDOWN_PARAGRAPHS= # Insert a blank line between paragraphs, like Markdown
HARD_WRAP=
WIDTH=78
while getopts ":n:wpblsmhW:" opt; do
@robin-a-meade
robin-a-meade / perl-iolayers-demo.pl
Last active April 17, 2022 21:48
perl io layers and -CSDA demo
#!/bin/perl
#!/bin/perl -CSDA # Try this variation
use v5.16.3;
use warnings;
use File::Temp qw(tempfile tempdir);
my @layers;
print 'tmp layers: ';
@robin-a-meade
robin-a-meade / binsearch-demo.pl
Created April 16, 2022 07:36
Binary search in perl esp. for finding closest element
#!/bin/perl
# Binary search in perl
# https://www.perlmonks.org/?node_id=920127
# Useful for finding closest element
# https://www.perlmonks.org/?node_id=927656
sub _unsigned_to_signed { unpack('j', pack('J', $_[0])) }
sub binsearch(&$\@) {
@robin-a-meade
robin-a-meade / perl-template.pl
Last active October 14, 2024 02:32
perl template boilerplate preamble
#############################################################################
# BEGIN MODERN PERL BOILERPLATE #
#############################################################################
# Use perl v5.16.3
# (We're tracking RHEL7 as our baseline)
# Note:
# - `use v5.12` or higher implies `use strict`
# https://stackoverflow.com/q/6050031
# https://perldoc.perl.org/feature