Skip to content

Instantly share code, notes, and snippets.

View Leward's full-sized avatar

Paul-Julien Vauthier Leward

View GitHub Profile
@Leward
Leward / Dockerfile
Created September 21, 2017 13:51
circleci/java:8-jdk with rancher-compose CLI
FROM circleci/java:8-jdk
ENV RANCHER_COMPOSE_VERSION=v0.12.5
RUN curl -sSL "https://github.com/rancher/rancher-compose/releases/download/${RANCHER_COMPOSE_VERSION}/rancher-compose-linux-amd64-${RANCHER_COMPOSE_VERSION}.tar.gz" | tar -xzp -C /usr/local/bin/ --strip-components=2
rm -rf /var/cache/*
@Leward
Leward / SpringtraderResourceServerApplication.java
Created February 7, 2017 16:42
springtrader-resource-server
package io.springtrader.resource;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.security.oauth2.provider.token.RemoteTokenServices;
@Leward
Leward / GreetingController.java
Created February 3, 2017 06:39
hello ribbon
package com.example;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.hateoas.Resources;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
@Leward
Leward / output.txt
Created September 20, 2016 22:27
Graphaware Timetree Embedded Neo4j Database
2016-09-20 22:25:59.916+0000 INFO [c.g.r.b.RuntimeKernelExtension] GraphAware Runtime enabled, bootstrapping...
2016-09-20 22:25:59.956+0000 INFO [c.g.r.b.RuntimeKernelExtension] Bootstrapping module with order 1, ID timetree, using com.graphaware.module.timetree.module.TimeTreeModuleBootstrapper
2016-09-20 22:26:00.080+0000 INFO [c.g.r.b.RuntimeKernelExtension] GraphAware Runtime bootstrapped, starting the Runtime...
2016-09-20 22:26:00.500+0000 INFO [c.g.r.b.RuntimeKernelExtension] GraphAware Runtime automatically started.
[name:db.constraints, signature:db.constraints() :: (description :: STRING?)]
[name:db.indexes, signature:db.indexes() :: (description :: STRING?, state :: STRING?, type :: STRING?)]
[name:db.labels, signature:db.labels() :: (label :: STRING?)]
[name:db.propertyKeys, signature:db.propertyKeys() :: (propertyKey :: STRING?)]
[name:db.relationshipTypes, signature:db.relationshipTypes() :: (relationshipType :: STRING?)]
[name:dbms.changePassword, signature:dbms.changePassword(password ::
@Leward
Leward / MissionDefinition.groovy
Created September 19, 2016 21:05
Groovy @builder with trait
trait MissionDefinition {
UUID id = UUID.randomUUID()
String label
String description
Integer teamSize
LocalDate startDate
LocalDate endDate
ActivityType activityType
String salesForceId
}
@Leward
Leward / keybase.md
Created September 4, 2016 15:40
keybase.md

Keybase proof

I hereby claim:

  • I am Leward on github.
  • I am leward (https://keybase.io/leward) on keybase.
  • I have a public key whose fingerprint is 4F28 C39A 0F75 32F3 5B32 D94A 506F CD6F 99C3 69B6

To claim this, I am signing this object:

@Leward
Leward / Dockerfile
Last active August 14, 2016 23:40
codenvy/ubuntu_rails + Jekykk Dockerfile
FROM leward/codenvy-jekyll
@Leward
Leward / Neo4jHelper.java
Last active February 25, 2016 21:58
Neo4jHelper
@Component
public class Neo4jHelper {
@Autowired
private Neo4jOperations neo4jOperations;
public <T extends DomainComponent> Set<T> queryAsSetWithSingleParam(String cypher, Object param1, Class<T> targetClass, String targetKey) {
Map<String, Object> params = new HashMap<>();
params.put("0", param1);
return queryAsSet(cypher, params, targetClass, targetKey);
@Leward
Leward / Main.java
Created February 24, 2016 21:25
OGM Test
public class Main {
public static void main(String[] args) {
Configuration config = new Configuration();
config
.driverConfiguration()
.setDriverClassName(HttpDriver.class.getName())
.setURI("http://localhost:7474");
SessionFactory sessionFactory = new SessionFactory(config, "fr.zenika.zenapp.ogm.domain");
@Leward
Leward / IdeaRepository.java
Last active February 15, 2016 22:59
@QueryResult
@Repository
public interface IdeaRepository extends GraphRepository<Idea> {
@Query("MATCH (i:Idea) WHERE id(i) = {0} WITH i " +
"OPTIONAL MATCH (u:User)-[:UPVOTE]->(i) " +
"WITH i, collect(u) as upVoters " +
"OPTIONAL MATCH (u:User)-[:DOWNVOTE]->(i) " +
"RETURN id(i) as ideaId, upVoters, collect(u) as downVoters ")
Iterable<IdeaVotesQueryResult> findVoters(Long id);