Skip to content

Instantly share code, notes, and snippets.

View arthurportas's full-sized avatar

Arthur Portas arthurportas

  • Jumia
  • Porto-Portugal
View GitHub Profile
@arthurportas
arthurportas / designer.html
Last active August 29, 2015 14:18
designer
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../paper-slider/paper-slider.html">
<link rel="import" href="../paper-checkbox/paper-checkbox.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
@arthurportas
arthurportas / MongoUserRepository.java
Last active March 19, 2016 21:43
Sample spring-data mongodb project setup with querydsl
import org.springframework.data.mongodb.repository.MongoRepository;
import com.arthurportas.domain.mongo.entities.User;
public interface UserRepository extends MongoRepository<User, Long> {
User findBySid(UUID userSid);
}
@arthurportas
arthurportas / FongoConfiguration.java
Created January 21, 2017 21:30
Sample spring-boot Fongo configuration
package com.arthurportas.config;
import com.github.fakemongo.Fongo;
import com.mongodb.Mongo;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.config.AbstractMongoConfiguration;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
@arthurportas
arthurportas / five-users.json
Created January 21, 2017 21:31
Sample data for test with NoSqlUnit
{
"user": {
"data": [
{
"id": "119bbacd-9c03-4044-867f-4c26e8f715f6",
"firstName": "Arthur",
"lastName": "Portas",
"email": "arthurportas[AT]gmail.com"
},
{
@arthurportas
arthurportas / UserRepositoryTest.java
Created January 21, 2017 21:33
Sample test with Spring-data-mongo repository and NoSqlUnit
package com.arthurportas.unit.repository;
import com.arthurportas.mongodb.example.repository.UserRepository;
import com.lordofthejars.nosqlunit.annotation.UsingDataSet;
import com.lordofthejars.nosqlunit.core.LoadStrategyEnum;
import com.lordofthejars.nosqlunit.mongodb.MongoDbRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
@arthurportas
arthurportas / UserRepository.java
Created January 21, 2017 21:34
User document Spring-data-mongodb repository
package com.arthurportas.mongodb.example.repository;
import com.arthurportas.mongodb.example.domain.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
/**
* Created by arthurportas on 21/01/2017.
*/
@Repository
@arthurportas
arthurportas / User.java
Created January 21, 2017 21:35
User document with Lombok
package com.arthurportas.mongodb.example.domain;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* Created by arthurportas on 21/01/2017.
*/
@Getter
@arthurportas
arthurportas / User.java
Created January 28, 2017 19:42
User.java
package com.arthurportas.mongodb.example.domain;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.time.ZonedDateTime;
import java.util.Date;
/**
@arthurportas
arthurportas / UserRepository.java
Created January 28, 2017 19:42
UserRepository.java
package com.arthurportas.mongodb.example.repository;
import com.arthurportas.mongodb.example.domain.User;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;