Skip to content

Instantly share code, notes, and snippets.

View alexanderankin's full-sized avatar

David Ankin alexanderankin

View GitHub Profile
@turtlemonvh
turtlemonvh / README.md
Last active October 8, 2023 23:04
Multi-level arg parse

Multi-level arg parse

Shows how to structure a python app using arg parse that goes down many levels.

The "trick" is to

  • add a subparsers S1[]
  • add parsers P1[] to your subparser S1[x]
  • add a new set of subparsers S2[] to one of those parsers P1[x]

How to use github as a maven repository

In this how-to it is being explained how to create a maven repository on github and how to use an existing one.

Creating a repository

  1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2

  2. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2

@alexanderankin
alexanderankin / Pennsylvania Electoral Map Masterlist.md
Last active February 10, 2020 03:45
Pennsylvania Electoral Map Masterlist
@raphw
raphw / run.sh
Last active February 18, 2024 08:48
Runs Mockito on Graal VM
#!/bin/bash
set -x
set -e
if [[ -z $1 ]]; then
echo "Specify location of Graal VM as first argument"
exit 1
fi
$1/bin/gu install native-image
rm -rf META-INF sample sample.build_artifacts.txt Sample.* *.jar
echo "public class Sample {
package com.example.custombodyannotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
@javahippie
javahippie / awesome-tech-feeds.md
Last active November 4, 2022 12:52
Awesome Tech RSS Feeds
@corneil
corneil / sdk-java.sh
Last active January 31, 2024 18:40
Easily select java version and distribution with sdkman
#!/bin/bash
function sdkj() {
if [ "$1" == "" ]; then
echo "Expected Version prefix"
exit 1
fi
PREFIX=$1
CONTAINS=$2
# list candidates in the order they were installed. Last matching installed will be selected.
CANDIDATES=$(ls -tr ~/.sdkman/candidates/java/)

Setup colima on ARM Mac to Run x86 Docker Images

Prerequisites

Install Rosetta for x86 instruction support on Mac

$ softwareupdate --install-rosetta