Skip to content

Instantly share code, notes, and snippets.

View druminski's full-sized avatar

Łukasz Drumiński druminski

  • Allegro
  • Warsaw, Poland
View GitHub Profile
@druminski
druminski / MappableException_casue_is_not_logged.patch
Created November 14, 2013 20:58
This is a patch which fix a bug described here: https://java.net/jira/browse/JERSEY-2225 Thanks that patch MappableException's cause will not be logged, only WebApplicationExcaption's cause are logged. The patch moves logging of an exception cause to a code block which is invoked when the server is dealing with WebApplicationException
Index: core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java (revision 307ffdadf89e53c685ecf7bec04e8711e61d310e)
+++ core-server/src/main/java/org/glassfish/jersey/server/ServerRuntime.java (revision )
@@ -452,11 +452,11 @@
if (waeResponse.hasEntity()) {
return waeResponse;
@druminski
druminski / Readme.md
Last active July 4, 2022 01:11
BigCache service example with external benchmarks

Cache service example. It uses fasthttp as an http server and bigcache as the cache.

External benchmarks are provided.

Running cache service

go run main.go

Server listens on 8080 port.

@druminski
druminski / tiff_dimensions.js
Last active February 18, 2024 21:43
JavaScript function reading dimensions of TIFF image. Helpful when you need such functionality in Google Apps Script.
/**
* Materials:
* How to read only portion of bytes in a file on Google Drive:
* https://stackoverflow.com/questions/60181888/google-apps-script-get-range-of-bytes-from-binary-file
* TIFF File structure: https://www.awaresystems.be/imaging/tiff/faq.html#q3
*/
const TIFF_IFD_FIELD_LENGTH_IN_BYTES = 12;
const NUMBER_OF_BYTES_TO_READ_FROM_FILE = 500000;