Skip to content

Instantly share code, notes, and snippets.

@cptwunderlich
cptwunderlich / FailureHandler.scala
Created February 9, 2024 14:38
scalafix rule for migrating Tapir's DecodeFailureHandler from v1.8 to v1.9
package v2_5
import scalafix.v1._
import scala.meta._
/* Type of sttp.tapir FailureHandler has changed.
Now it takes a type parameter for the effect type. We need to add that and
change the return type of the apply method.
*/
@cptwunderlich
cptwunderlich / hibernate4-maven-plugin-exception.log
Created January 28, 2016 10:12
hibernate4-maven-plugin exception Stack trace
[INFO] --- hibernate4-maven-plugin:1.1.0:export (default) @ project-ejb ---
[INFO] Scanning directory C:\projects\project_demo\lo\project-ejb\target\classes for annotated classes...
[INFO] Scanning dependencies for scope compile
[INFO] Scanning dependency at.company:logis3-ejb:ejb:1.0-SNAPSHOT for annotated classes...
[INFO] Reading settings from hibernate.properties on the classpath.
[INFO] Reading settings from hibernate.cfg.xml on the classpath.
[INFO] HHH000044: Configuring from URL: file:/C:/projects/project_demo/lo/project-ejb/target/classes/hibernate.cfg.xml
[INFO] HHH000041: Configured SessionFactory: java:/projectSessionFactory
[INFO] HHH000318: Could not find any META-INF/persistence.xml file in the classpath
[INFO] Found no META-INF/persistence.xml.
@cptwunderlich
cptwunderlich / m2e_maven-jaxb2-plugin.log
Created January 26, 2016 10:01
Error message of m2e 1.6.2 with org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1
Description Resource Path Location Type
Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate failed: A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/codemodel/CodeWriter
-----------------------------------------------------
realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/bm/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.13.1/maven-jaxb2-plugin-0.13.1.jar
urls[1] = file:/C:/Users/bm/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.13.1/maven-jaxb2-plugin-core-0.13.1.jar
urls[2] = file:/C:/Users/bm/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar
urls[3] = file:/C:/Users/bm/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar
urls[4] = file:/C:/Users/bm/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
@cptwunderlich
cptwunderlich / gist:b088e8e5d6116084ba94
Created December 15, 2015 13:53
M2E + maven-jaxb2-plugin Exception
Description Resource Path Location Type
Execution default of goal org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate failed: A required class was missing while executing org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1:generate: com/sun/xml/bind/api/ErrorListener
-----------------------------------------------------
realm = plugin>org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.13.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/C:/Users/bm/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin/0.13.1/maven-jaxb2-plugin-0.13.1.jar
urls[1] = file:/C:/Users/bm/.m2/repository/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-core/0.13.1/maven-jaxb2-plugin-core-0.13.1.jar
urls[2] = file:/C:/Users/bm/.m2/repository/org/apache/commons/commons-lang3/3.2.1/commons-lang3-3.2.1.jar
urls[3] = file:/C:/Users/bm/.m2/repository/com/sun/org/apache/xml/internal/resolver/20050927/resolver-20050927.jar
urls[4] = file:/C:/Users/bm/.m2/repository/junit/junit/4.8.1/junit-4.8.1.jar
@cptwunderlich
cptwunderlich / aes_gcm_encryption.py
Created September 1, 2015 21:28
Implemented examples from https://docs.pushbullet.com/#end-to-end-encryption in python2/3 with python-cryptography (https://cryptography.io)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from binascii import a2b_base64, b2a_base64
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import (