Skip to content

Instantly share code, notes, and snippets.

@jgrgt
jgrgt / keybase.md
Last active September 19, 2018 20:03
Keybase Proof

Keybase proof

I hereby claim:

  • I am jgrgt on github.
  • I am jensgeiregat (https://keybase.io/jensgeiregat) on keybase.
  • I have a public key whose fingerprint is 0E60 1C75 4EAE 8991 7293 839C F40A 1ED9 AC49 6619

To claim this, I am signing this object:

class DefaultXConnector {
// ...
@Override
rx.Observable<JsonObject> getSessionWithTimeout(JsonObject jsonObject, long timeout) {
log.debug('Getting session with timeout {} for query: {} ({}, {})', timeout, jsonObject, this, this.eventBus)
return eventBus.sendWithTimeout(ServiceLocation.BUS_SESSION_SERVICE_LOCATION, jsonObject, timeout).map(body(true))
}
public static <T> Func1<RxMessage<T>, T> body(boolean logMessage) {
return { RxMessage<T> message ->
@jgrgt
jgrgt / package.json
Created March 13, 2015 08:55
Locking up an npm connect proxy
{
"devDependencies": {
"connect": "~3.3.4",
"proxy-middleware": "~0.11.0",
"url": "~0.10.3",
"http": "0.0.0"
},
"scripts": {
"start": "node server.js"
}
@jgrgt
jgrgt / zip-vs-from.groovy
Created September 16, 2015 05:46
Experimenting with flatMap, concat and buffer in RxJava.
@Grab('com.netflix.rxjava:rxjava-joins:0.19.6')
import rx.Observable
import rx.functions.Func1
import rx.functions.Action1
import java.util.concurrent.TimeUnit
def range = new IntRange(5, 0)
range.each { println it}
@jgrgt
jgrgt / readBson.groovy
Created November 4, 2015 08:13
Read bson files to documents in Java/Groovy
/**
* Publishing this publicly because it took me so long to get to this stage:
* - Using a memory-mapped byte buffer because I will handle *large* files.
* - Not too happy with the end of my loop, but I could not find how to check for the end of the buffer otherwise.
*/
import org.bson.BsonBinaryReader
import org.bson.BsonReader
import org.bson.Document
import org.bson.codecs.DecoderContext
import org.bson.codecs.DocumentCodec
@jgrgt
jgrgt / digoo-station.yaml
Created July 18, 2023 20:35 — forked from zry98/digoo-station.yaml
Digoo weather station sensor component for ESPHome
substitutions:
device_name: 'Digoo Station'
external_location: 'Balcony'
rf_receiver_pin: '4'
digoo_sensor_channel: '2'
digoo_sensor_id: '9'
esphome:
name: digoo-station
comment: 'ESP station for environment monitoring'