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
// Test.java
import com.microsoft.azure.iot.service.sdk.DeliveryAcknowledgement;
import com.microsoft.azure.iot.service.sdk.IotHubServiceClientProtocol;
import com.microsoft.azure.iot.service.sdk.Message;
import com.microsoft.azure.iot.service.sdk.ServiceClient;
import java.nio.charset.StandardCharsets;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@dluc
dluc / BugFeedbackTimeoutAsync.java
Last active November 26, 2016 03:37
[Azure IoT][Java] Feedback receiver doesn't timeout [async version]
package com.microsoft.azure.iothub;
import com.microsoft.azure.iot.service.sdk.FeedbackBatch;
import com.microsoft.azure.iot.service.sdk.FeedbackReceiver;
import com.microsoft.azure.iot.service.sdk.IotHubServiceClientProtocol;
import com.microsoft.azure.iot.service.sdk.ServiceClient;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@dluc
dluc / BugFeedbackTimeoutSync.java
Last active November 26, 2016 03:38
[Azure IoT][Java] Feedback receiver doesn't timeout [sync version]
package com.microsoft.azure.iothub;
import com.microsoft.azure.iot.service.sdk.FeedbackReceiver;
import com.microsoft.azure.iot.service.sdk.IotHubServiceClientProtocol;
import com.microsoft.azure.iot.service.sdk.ServiceClient;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@dluc
dluc / gist:5f64cc3bdfd9cc89b439511885c68859
Created November 23, 2016 22:59
C2D ServiceClientSample
/*
* Copyright (c) Microsoft. All rights reserved.
* Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
import com.microsoft.azure.iot.service.sdk.*;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Date;
@dluc
dluc / AzureIoTJavaServiceSDKSample.java
Created November 9, 2016 20:44
Azure IoT Java Service SDK Sample
package com.company;
import com.microsoft.azure.iot.service.sdk.*;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@dluc
dluc / TypedAkkaSink.scala
Last active November 4, 2016 21:56
Typed Akka sink
case class IoTHub() {
def source(): Source[MessageFromDevice, NotUsed] = /* ... */
def sink[A]()(implicit typedSink: TypedSink[A]): Sink[A, Future[Done]] = typedSink.definition
}
trait TypedSink[A] {
def definition: Sink[A, Future[Done]]
}

Keybase proof

I hereby claim:

  • I am dluc on github.
  • I am devis (https://keybase.io/devis) on keybase.
  • I have a public key ASAqKf0qDP-UL3yWsfNW557yWMjZf3JsaAhsn2KkmCTYzgo

To claim this, I am signing this object:

@dluc
dluc / git-gpg.md
Created October 28, 2016 02:30 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@dluc
dluc / .profile
Created October 28, 2016 02:29 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else