Skip to content

Instantly share code, notes, and snippets.

View christianbauer's full-sized avatar

Christian Bauer christianbauer

View GitHub Profile
@christianbauer
christianbauer / GrepConsole.xml
Last active December 17, 2017 10:54
GrepConsole IntelliJ plugin configuration, copy into ~/Library/Preferences/IntelliJIdea2016.3/options/GrepConsole.xml
<application>
<component name="GrepConsole">
<option name="profiles">
<list>
<Profile>
<option name="defaultProfile" value="true" />
<option name="grepExpressionGroups">
<list>
<GrepExpressionGroup>
<option name="enabled" value="true" />
public class ElementalJsonDeserializer extends JsonDeserializer<JsonValue> {
@Override
protected JsonValue doDeserialize(JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params) {
if (reader.hasNext()) {
String nextValue = reader.nextValue();
JsonValue value = Json.instance().parse(nextValue);
value = makeCastableToJavaScriptObject(value);
return value;
}
package org.openremote.test.rules;
import org.openremote.model.*;
import org.openremote.model.asset.*
import elemental.json.Json;
global java.util.logging.Logger LOG;
global org.openremote.model.rules.Assets assets;
rule "Switch room lights off when apartment ALL LIGHTS OFF switch is off"
@christianbauer
christianbauer / agent.json
Last active December 10, 2016 17:37
Agent/Thing asset model
{
"id": "ekOo0puKRdGtBhDOOFzBfA",
"type": "urn:openremote:asset:agent",
"name": "TestAgent 123",
"coordinates": [
5.460315214821094,
51.44541688237109
],
"attributes": {
"hueBridge456": {
Computing all possible rebind results for 'org.jboss.errai.ioc.client.Bootstrapper'
Rebinding org.jboss.errai.ioc.client.Bootstrapper
Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.IOCGenerator
generating ioc bootstrapping code...
Apr 19, 2016 5:21:14 PM org.jboss.errai.common.rebind.CacheUtil clearAll
INFO: clearing all generation caches...
java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy86.toString(Unknown Source)
at org.jboss.errai.codegen.meta.impl.AbstractMetaClass.hashContent(AbstractMetaClass.java:761)
at org.jboss.errai.codegen.meta.MetaClassCache.createCacheEntry(MetaClassCache.java:183)
Computing all possible rebind results for 'org.jboss.errai.marshalling.client.api.MarshallerFactory'
Rebinding org.jboss.errai.marshalling.client.api.MarshallerFactory
Invoking generator org.jboss.errai.marshalling.rebind.MarshallersGenerator
Generating Marshallers Bootstrapper...
Apr 15, 2016 10:06:30 AM org.jboss.errai.common.rebind.CacheUtil clearAll
INFO: clearing all generation caches...
Apr 15, 2016 10:06:30 AM org.jboss.errai.config.rebind.AsyncGenerators startAll
INFO: discovered async generator org.jboss.errai.bus.rebind.RpcProxyLoaderGenerator; for type: org.jboss.errai.bus.client.framework.RpcProxyLoader
Apr 15, 2016 10:06:30 AM org.jboss.errai.config.rebind.AsyncGenerators startAll
INFO: discovered async generator org.jboss.errai.enterprise.rebind.EventQualifierSerializerGenerator; for type: org.jboss.errai.enterprise.client.cdi.EventQualifierSerializer
@christianbauer
christianbauer / JacksonRawValueModule.java
Created August 24, 2015 22:26
Deserialization support for @JsonRawValue in Jackson
public class JacksonRawValueModule extends SimpleModule {
class RawValueDeserializer extends JsonDeserializer<String> implements ContextualDeserializer {
@Override
public String deserialize(JsonParser jp, DeserializationContext ctx) throws IOException {
TreeNode tree = jp.getCodec().readTree(jp);
return tree.toString();
}
@Override
<template>
<console-panels>
<console-panel id="8" name="Office">
<console-include-group ref="9"></console-include-group>
</console-panel>
<console-groups>
<console-group id="9" name="Default Group">
<console-include-screen ref="10"></console-include-screen>