Skip to content

Instantly share code, notes, and snippets.

Avatar

David Blevins dblevins

View GitHub Profile
View jakarta-packages.adoc

Status of Jakarta’s javax packages

Complete Renamed Packages

Package

Specification

Exclusions

javax.activation

JavaBeansTM Activation Framework

View buildtime.sh
#!/bin/bash -l
function log {
echo "LOG $(date +"%Y-%m-%d %H:%M:%S") $1"
}
function fail {
log "$1"
View CommandLine.markdown

Linux/OSX awesomeness

Not specific to this projec, but can be incredibly useful ways to maximizes your time. Mastering the command line is the best way to get things done, quick and cheaply.

Reapeat after me:

  • I will write a script for any tasks I do regularly

Core commands

View buildtime.sh
#!/bin/bash
cd /tmp &&
git clone https://github.com/apache/tomee.git &&
cd tomee || exit 1
##
## Grab the same revision so we're all comparing the
## exact same code
##
@dblevins
dblevins / Dates.java
Last active May 28, 2022 20:02
Works for Java 8 and above. For Java 7 and before, see this legacy version https://gist.github.com/dblevins/03df3cd5eb12f2da05997eef80ac4eca
View Dates.java
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
/**
* This pattern has the following benefits:
*
* - Date formats are referenced as a strong type
* - Code completion on patterns
View jakartaee-api-9.1-M2-SNAPSHOT-tomcat.jar.txt
META-INF/
META-INF/DEPENDENCIES
META-INF/LICENSE
META-INF/LICENSE.md
META-INF/LICENSE.txt
META-INF/MANIFEST.MF
META-INF/NOTICE
META-INF/NOTICE.md
META-INF/mailcap.default
META-INF/maven/
View javaee-api-8.0-6-tomcat.jar.txt
META-INF/MANIFEST.MF
META-INF/
META-INF/DEPENDENCIES
javaee-api-feature.xml
org/
org/apache/
org/apache/openejb/
org/apache/openejb/javaee/
org/apache/openejb/javaee/api/
org/apache/openejb/javaee/api/activator/
View MapperAPI-Exceptions.adoc
View JsonbAPI-Exceptions.adoc
# Jsonb API scenario current proposed

1

JsonbCreator

constructor

JsonbException

JsonbException

2

JsonbCreator

factory

JsonbException

JsonbException

3

Deserialization

arrayOfShortFromString

JsonbException

JsonbException

View chars-vs-bytes.java
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
public class Foo {
public static void main(String[] args) throws IOException {
final char c = 'ñ';
final ByteArrayOutputStream baos = new ByteArrayOutputStream();