Skip to content

Instantly share code, notes, and snippets.

Working from home

Thomas Darimont thomasdarimont

Working from home
Block or report user

Report or block thomasdarimont

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import lombok.Data;
public class ConfigSettingValue implements Serializable {
private static final long serialVersionUID = 1L;
thomasdarimont / Rook.r
Created Jun 5, 2014
Simple (integrated) Web Server that returns JSON in R
View Rook.r
server <- Rhttpd$new()
app <- function(env) { # Note: 5
errors <- c()
warnings <- c()
val <- c()
import static org.mockito.Mockito.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
public class DependencyOverrideExampleTests {
thomasdarimont /
Last active Aug 29, 2015
This gist demonstrates the PoC for the upcoming support for dynamic binding of SpEL expression in string based and derived queries.
package demo;
import java.util.List;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
thomasdarimont / 0_ExprExample.js
Last active Jun 7, 2018
Simpler arithmetic expression syntax for MongoDB Aggregation Framework via AST Transformations
View 0_ExprExample.js
> expr("(a+b)*c")
{ "$multiply" : [ { "$add" : [ "$a", "$b" ] }, "$c" ] }
> expr("1+2*2+3")
"$add" : [
"$add" : [
import org.springframework.core.env.SystemEnvironmentPropertySource;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
* [USER=136855]@author[/USER] Thomas Darimont

Initially we also had support for SpEL Expression parameters in query derivation but we decided to leave it out for now, since we had some concerns whether having SpEL expressions in user code is a good idea.

Configure SpEL expression as a bean

Expression currentUserEmailAdress(){
	return new SpelExpressionParser().parseExpression("principal?.emailAddress");
thomasdarimont /
Last active Aug 29, 2015
Add support for EL expressions in JPA-QL and native queries.

Add support for EL expressions in JPA-QL and native queries.

This proposal suggests adding support using [EL expressions] ( in JPA query strings. With this one could define query string templates and dynamic parameter bindings based on EL (Expression Language).

  • Immediate evaluation (via ${...}) could be used to statically alter the query string in cases where the user wants to statically generate a fixed part of a query. This could be used to add query fragments or adjust the name of tables or columns / fields.

  • Deferred evaluation (via #{...}) could be used to dynamically compute a parameter value in cases where the user

* Copyright 2011-2014 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
thomasdarimont / publicStreamMethods.cypher
Created Jul 22, 2014
List all publicly available Methods in JDK 8 that return a Stream with the help of, I wasn't aware of and :)
View publicStreamMethods.cypher
match (t:Type)-[:DECLARES]->(m:Method)-[:RETURNS]->(rt:Type)
where rt.fqn = "" and t.visibility = 'public' and m.visibility = 'public'
return distinct(t.fqn+"." as fqmn
You can’t perform that action at this time.