Skip to content

Instantly share code, notes, and snippets.

View zcourts's full-sized avatar

Courtney Robinson zcourts

View GitHub Profile

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
@zcourts
zcourts / README.md
Created July 24, 2021 06:06 — forked from sma/README.md
This is an ad-hoc Java-to-Dart translator written in three days. This is version 2 which some bug fixes.

Java to Dart

This is an ad-hoc Java-to-Dart translator originally written on two (admittedly long) evenings.

See http://sma.github.io/stuff/java2dartweb/java2dartweb.html for a demo.

Note: It doesn't support the complete Java grammar specification and cannot translate everything. It only translates syntax and does not attempt to translate Java library classes and methods to Dart equivalents (with the exception of String.charAt and StringBuffer.append). You will have to make changes to the resulting Dart code. It does not support anonymous inner classes.

However, I was able to successfully convert a 7000+ line command line application with only minimal fixes in 30 minutes.

@zcourts
zcourts / stripe.openapi.yaml
Created June 14, 2021 15:24
Some OpenAPI specs for testing with
This file has been truncated, but you can view the full file.
---
components:
schemas:
account:
description: |-
This is an object representing a Stripe account. You can retrieve it to see
properties on the account like its current e-mail address or if the account is
enabled yet to make live charges.
Some properties, marked below, are available only to platforms that want to
@zcourts
zcourts / 00_README.md
Created May 12, 2021 10:54 — forked from md5/00_README.md
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
@zcourts
zcourts / ParseRSAKeys.java
Created March 1, 2021 04:55 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
  1. spotify:playlist:4PRmVDCJmdeGBcJRmQNQUf

By using the measurement protocol events can be sent to GA with any HTTP client (brower or server side).

curl 'https://www.google-analytics.com/collect' \
  -H 'user-agent: switch-server' \
  --data-raw 'v=1&t=event&tid=UA-XXXXXXXX-Y&cid=cid3&ec=upgrade&ea=start_trial&el=Start%20trial&ev=1' \
  --compressed

Note: user-agent is required. OR

# ATTENTION PLEASE!
# NOTE BY @riwazp7
# Note for future visitors of this gist: Mac OS has Apache Benchmark by default ab --help
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install
# brew install 'https://raw.github.com/simonair/homebrew-dupes/e5177ef4fc82ae5246842e5a544124722c9e975b/ab.rb'
@zcourts
zcourts / tmux cheat sheet
Last active April 30, 2024 10:53
tmux cheat sheet image from DuckDuckGo UI
https://duckduckgo.com/?q=tmux+cheat+sheet&atb=v47-1_x&ia=cheatsheet&iax=1
@zcourts
zcourts / Jenkinsfile
Created August 17, 2019 21:50 — forked from abayer/Jenkinsfile
An example Declarative Pipeline Jenkinsfile for Feb 15 2017 demo
// A Declarative Pipeline is defined within a 'pipeline' block.
pipeline {
// agent defines where the pipeline will run.
agent {
// This also could have been 'agent any' - that has the same meaning.
label ""
// Other possible built-in agent types are 'agent none', for not running the
// top-level on any agent (which results in you needing to specify agents on
// each stage and do explicit checkouts of scm in those stages), 'docker',