Skip to content

Instantly share code, notes, and snippets.

Avatar

David Blevins dblevins

View GitHub Profile
View HappyFunBall.java
import javax.annotation.PostConstruct;
import javax.ejb.Lock;
import javax.ejb.LockType;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManagerFactory;
@Singleton // Only need one of these
View CombinedRealm.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
View LockoutRealm.java
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
View executable-jar.sh
#!/bin/bash
git clone git@github.com:tomitribe/tomee-jaxrs-starter-project.git &&
cd tomee-jaxrs-starter-project &&
mvn clean install tomee:exec &&
java -jar target/tomee-rest-arquillian-1.0-SNAPSHOT-exec.jar
View simple-microservice.sh
#!/bin/bash
git clone git@github.com:tomitribe/simple-microservice.git &&
cd simple-microservice &&
mvn clean install &&
java -jar target/microservice-1.1.0-SNAPSHOT.jar
View FileConstraints.java
import java.io.File;
import java.lang.annotation.Annotation;
public class FileConstraints {
{
final Mapper mapper = new Mapper();
mapper.map(Executable.class, File.class, File::canExecute);
mapper.map(Writable.class, File.class, File::canWrite);
View termcolors.sh
#!/bin/bash
cat > /tmp/termcolors.java <<EOF
public class termcolors {
public static void main(String[] args) {
for (int i = 0; i < 256; i++) {
System.out.printf("\033[38;5;%sm#@%03d", i, i);
System.out.print(" ");
if (i % 12 == 0) System.out.println();
View get_color.sh
#!/bin/bash
STRING=$(echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | base64)
SIGNATURE=$(
echo -n "(request-target): get /signature-prototype-1.0-SNAPSHOT/api/colors/preferred
date: Tue, 07 Jun 2014 20:51:35 GMT" | openssl dgst -binary -sha256 -hmac "PennyLunaLuka" | base64)
View EJB_SPEC-60_tests-mar-19.patch
Index: devtests/ejb/ejb32/mdb/ejb/ResultsBean.java
===================================================================
--- devtests/ejb/ejb32/mdb/ejb/ResultsBean.java (revision 0)
+++ devtests/ejb/ejb32/mdb/ejb/ResultsBean.java (revision 0)
@@ -0,0 +1,40 @@
+package com.sun.s1asdev.ejb.ejb32.mdb.ejb;
+
+import javax.ejb.LocalBean;
+import javax.ejb.Lock;
+import javax.ejb.LockType;
View EJB_SPEC-60_RI_mar-19.diff
Index: appserver/ejb/ejb-container/src/main/java/org/glassfish/ejb/deployment/descriptor/EjbMessageBeanDescriptor.java
===================================================================
--- appserver/ejb/ejb-container/src/main/java/org/glassfish/ejb/deployment/descriptor/EjbMessageBeanDescriptor.java (revision 59286)
+++ appserver/ejb/ejb-container/src/main/java/org/glassfish/ejb/deployment/descriptor/EjbMessageBeanDescriptor.java (working copy)
@@ -41,10 +41,12 @@
package org.glassfish.ejb.deployment.descriptor;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.Collection;