Skip to content

Instantly share code, notes, and snippets.

View dluc's full-sized avatar
🏠
Working from home

Devis Lucato dluc

🏠
Working from home
View GitHub Profile
> [!NOTE]  
> Highlights information that users should take into account, even when skimming.

Note

Highlights information that users should take into account, even when skimming.


@dluc
dluc / IgnoreTrailingSlashesRequestHandler.java
Created July 10, 2018 01:47
Play Framework 2.6 Request Handler to ignore trailing slash
import com.google.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import play.api.mvc.Handler;
import play.api.mvc.Handler$;
import play.api.mvc.RequestHeader;
import play.core.j.JavaHandler;
import play.core.j.JavaHandlerComponents;
import play.http.HandlerForRequest;
import play.http.HttpRequestHandler;
import play.libs.streams.Accumulator;
:100644 100644 e163037... 0000000... M build.sbt
:100644 100644 97381e7... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/CheckpointActorSystem.scala
:100644 100644 7d3fc76... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/CheckpointService.scala
:100644 100644 997a9c9... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/Configuration.scala
:100644 100644 db3d580... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/backends/AzureBlob.scala
:100644 100644 96bf8a3... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/backends/CassandraTable.scala
:100644 100644 d17aed3... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/backends/CheckpointBackend.scala
:100644 100644 91bfb71... 0000000... M src/main/scala/com/microsoft/azure/iot/iothubreact/checkpointing/backends/cassandra/lib/Connection.scala
:100644 100644 c954630... 0000000... M src/main
@dluc
dluc / update-gists.sh
Last active March 3, 2017 20:12
Keeping a set of gist-files up to date
#!/usr/bin/env bash
# Source: https://gist.github.com/7d4950d4d4c046fcd3162fddaba0dca5
#
# * Works with `gist` CLI (https://github.com/defunkt/gist)
# * Files are created manually
# * Requires login: `gist --login`
# * Gist URL: https://gist.github.com/<gist id>
# * Raw URL: https://gist.githubusercontent.com/<user name>/<gist id>/raw/<file name>
@dluc
dluc / BugStatusIsUnknownAfterMaxDeliveryCountExceeded.java
Created December 6, 2016 05:57
Azure C2D, status of abandoned messages [2 files]
// BugStatusIsUnknownAfterMaxDeliveryCountExceeded.java
import com.microsoft.azure.iot.service.sdk.*;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.UUID;
@dluc
dluc / BugStatusIsUnknownAfterReject.java
Created December 6, 2016 05:44
Azure C2D, status of rejected messages [2 files]
// BugStatusIsUnknownAfterReject.java
import com.microsoft.azure.iot.service.sdk.*;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.UUID;
@dluc
dluc / TestSync.java
Created November 29, 2016 20:49
Azure IoT issue 968 - synchronous
/*
Dependencies:
iothub-java-service-client 1.0.10
iothub-java-device-client 1.0.15
*/
import com.microsoft.azure.iot.service.sdk.*;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@dluc
dluc / log.txt
Created November 29, 2016 02:06
Azure IoT SDK Issue 997 log
[17:40:34.910] Creating service client
[17:40:35.155] Open service client connection
[17:40:35.163] Sending msg #0, To: 'device1001', ID: b0f0d1ea-59f0-4c0b-b227-16d770f1179f, Expire: Mon Nov 28 18:40:35 PST 2016
[17:40:36.578] Sending msg #1, To: 'device1001', ID: cf5d25ff-23f7-4c70-9913-c50dac197d9f, Expire: Mon Nov 28 18:40:36 PST 2016
[17:40:37.752] Sending msg #2, To: 'device1001', ID: da060f2d-5050-41a4-8182-318fdbebf502, Expire: Mon Nov 28 18:40:37 PST 2016
[17:40:38.506] Sending msg #3, To: 'device1001', ID: 6f621dbe-7fad-48fa-843f-b98c42ed57bf, Expire: Mon Nov 28 18:40:38 PST 2016
[17:40:39.260] Sending msg #4, To: 'device1001', ID: 9630a4ae-d5c2-4083-98e9-b762a6ef7328, Expire: Mon Nov 28 18:40:39 PST 2016
[17:40:40.478] Sending msg #5, To: 'device1001', ID: 94d8bc3b-701a-4734-880b-3d9021a862a5, Expire: Mon Nov 28 18:40:40 PST 2016
[17:40:41.682] Sending msg #6, To: 'device1001', ID: 4882bb5a-4e13-4337-ab00-ff19c3b1d173, Expire: Mon Nov 28 18:40:41 PST 2016
[17:40:42.467] Sending msg #7, To: 'device1
@dluc
dluc / BugQueuedMessagesProcessing.java
Last active December 8, 2016 20:14
Azure C2D messages in the queue processing issues
// BugQueuedMessagesProcessing.java
import com.microsoft.azure.iot.service.sdk.*;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.UUID;
@dluc
dluc / BugStatusIsCompletedBeforeCompletion.java
Last active May 2, 2019 01:42
Azure IoT SDK message status is set to SUCCESS when in the queue
// BugStatusIsCompletedBeforeCompletion.java
import com.microsoft.azure.iot.service.sdk.*;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Date;
import java.util.UUID;