This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Filed Spring Data Rest bug | |
| //https://jira.spring.io/browse/DATAREST-1034 | |
| //so check there for answers | |
| @RepositoryRestResource(path='emUsers', exported = false) | |
| interface EMUserRepository extends EnversRevisionRepository<EMUser, Long, Integer>, JpaSpecificationExecutor<EMUser> { | |
| //Attempting, as an example, to expose only this /search/findByAuth0UserId endpoint | |
| //but with @RepositoryRestResource(exported=false) this endpoint is not exported | |
| //but with @RepositoryRestResource(exported=true) this endpoint is exported | |
| @RestResource(exported = true) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //See full source with HTML at jsfiddle: | |
| // https://jsfiddle.net/jeffsheets/ry2ns0s7/4/ | |
| function node(val, left, right) { | |
| return {val: val, left: left, right: right, visited: false}; | |
| } | |
| /* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BinarySearch { | |
| def bfs(def node, def result=[]) { | |
| Queue queue = new LinkedList() | |
| queue.add(node) | |
| while (queue) { | |
| def it = queue.poll() | |
| result << it.val |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.Arrays; | |
| public class WorstFizzBuzzEver { | |
| public static final String BUZZ = "Fizz"; | |
| public static final String FIZZ = "Buzz"; | |
| /* | |
| * This does Fizz Buzz | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.hibernate.jpa.HibernatePersistenceProvider; | |
| import org.springframework.context.annotation.Configuration; | |
| import javax.annotation.PostConstruct; | |
| import javax.persistence.spi.PersistenceProvider; | |
| import javax.persistence.spi.PersistenceProviderResolver; | |
| import javax.persistence.spi.PersistenceProviderResolverHolder; | |
| import java.util.Collections; | |
| import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package org.springframework.web.servlet.handler | |
| import org.springframework.web.context.WebApplicationContext | |
| /** | |
| * Workaround to register a controller with the WebAppContext because detectHandlerMethods is protected | |
| * | |
| * This allows our Mvc Unit tests to use the wired up Spring Jackson converters and mappers, | |
| * without having to specify them individually in every test | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.sheetsj.spring.async.test | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import org.springframework.scheduling.annotation.Async | |
| import org.springframework.scheduling.annotation.AsyncResult | |
| import org.springframework.scheduling.annotation.EnableAsync | |
| import org.springframework.test.context.ContextConfiguration | |
| import org.springframework.util.concurrent.ListenableFuture | |
| import org.springframework.util.concurrent.ListenableFutureCallback |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var someService; | |
| beforeEach(inject(function (_someService_) { | |
| someService = sinon.mock(_someService_); | |
| })); | |
| afterEach(function () { | |
| entityServiceFactory.verify(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContentTypeMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter { | |
| /** | |
| * Always set the Content-Type response header to application/json when using the Jackson message converter | |
| * | |
| * Without this there appears to be a conflict with Meteor/Atmosphere servlet that causes Spring | |
| * to leave the Content-Type blank in the response | |
| * https://groups.google.com/forum/#!topic/atmosphere-framework/uZOrfXl3Bu8 | |
| */ | |
| @Override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The Crazy Doodle app available on the Amazon Kindle and Google Play stores does NOT collect any information. |