Skip to content

Instantly share code, notes, and snippets.

@baldram
baldram / SttpSupportGzipEncodingWithEmptyResponse.test.scala
Created April 9, 2023 13:54
"Sttp test reproducing java.io.EOFException/GZIPInputStream bug"
//> using lib "org.scalatest::scalatest:3.2.15"
//> using lib "com.softwaremill.sttp.client3::core:3.8.14"
//> using lib "com.softwaremill.sttp.client3::okhttp-backend:3.8.14"
//> using lib "com.softwaremill.sttp.client3::async-http-client-backend-zio1:3.8.14"
//> using lib "com.softwaremill.sttp.client3::async-http-client-backend-cats:3.8.14"
//> using lib "org.typelevel::cats-effect:3.4.8"
//> using lib "com.softwaremill.sttp.client3::async-http-client-backend-future:3.8.14"
//> using lib "com.github.tomakehurst:wiremock:2.27.2"
//> using jvm "17"
@baldram
baldram / ErraiGwtBeansLookUp.java
Last active February 13, 2016 19:34
Client-Side Bean Manager. Example of looking up beans through the use of the lookupBeans() method implemented in generic way. Example usage: SomeViewType mapView = getView(SomeViewType.class);More here: http://docs.jboss.org/errai/3.2.2.Final/errai/reference/html_single/#d0e3223
@Inject
private SyncBeanManager manager;
public <T extends Composite> T getView(Class<T> type) {
T view = null;
IOCBeanDef<T> bean = manager.lookupBean(type);
if (bean != null) {
view = bean.getInstance();
}
return view;