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
killall -9 mongod | |
killall -9 mongo | |
mkdir -p /usr/local/var/mongodb | |
mkdir -p /usr/local/var/mongodb-slave1 | |
mkdir -p /usr/local/var/mongodb-slave2 | |
mongod --port 27017 --master --dbpath /usr/local/var/mongodb --replSet rs0 --config mongodb.conf & | |
mongod --port 37017 --slave --dbpath /usr/local/var/mongodb-slave1 --replSet rs0 --config mongodb.conf & | |
mongod --port 47017 --dbpath /usr/local/var/mongodb-slave2 --replSet rs0 --config mongodb.conf & |
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
#!/usr/bin/env node | |
var walk = require('walk'); | |
var files = []; | |
var excludeFolders = ['.git','test','scripts','logs','config']; | |
var excludeFiles = ['README.md','pack.js','testem.json','key.pem','.DS_Store','.gitignore'] | |
// Walker options | |
var walker = walk.walk('.', { followLinks: false }); | |
var matchExcludeFolders = function(root) { |
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
@Bean | |
static PropertySourcesPlaceholderConfigurer properties() { | |
PropertySourcesPlaceholderConfigurer pspc = new PropertySourcesPlaceholderConfigurer() | |
ListPropertySources sources = new ListPropertySources([ | |
new GroovyConfigPropertySource('file-override', new UrlResource('file:///data/Config.groovy')), | |
new GroovyConfigPropertySource('config', new ClassPathResource('config/Config.config')) | |
]) | |
pspc.setPropertySources(sources) |
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.in3k8.javaconfig.config.propertysource | |
import org.springframework.core.env.PropertySources | |
import org.springframework.core.env.PropertySource | |
class ListPropertySources implements PropertySources { | |
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.in3k8.javaconfig.config.propertysource | |
import org.springframework.core.env.PropertySource | |
import org.springframework.core.io.Resource | |
class GroovyConfigPropertySource extends PropertySource { | |
Resource resource | |
Map configObject = [:] |
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.lang.annotation.Documented | |
import java.lang.annotation.ElementType | |
import java.lang.annotation.Retention | |
import java.lang.annotation.RetentionPolicy | |
import java.lang.annotation.Target | |
@Target(ElementType.PARAMETER) |
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.springframework.core.MethodParameter | |
import org.springframework.http.converter.StringHttpMessageConverter | |
import org.springframework.mock.web.MockHttpServletRequest | |
import org.springframework.mock.web.MockHttpServletResponse | |
import org.springframework.web.context.request.ServletWebRequest | |
import org.springframework.web.method.support.ModelAndViewContainer | |
import spock.lang.Specification |
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.springframework.core.MethodParameter | |
import org.springframework.http.HttpInputMessage | |
import org.springframework.http.converter.HttpMessageConverter | |
import org.springframework.web.bind.support.WebDataBinderFactory | |
import org.springframework.web.context.request.NativeWebRequest | |
import org.springframework.web.method.support.ModelAndViewContainer | |
import org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor | |
class OptionalRequestBodyMethodProcessor extends RequestResponseBodyMethodProcessor { |
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
<mvc:annotation-driven conversion-service="conversionService"> | |
<mvc:argument-resolvers> | |
<bean class="OptionalRequestBodyMethodProcessor" > | |
<constructor-arg name="messageConverters" ref="customMessageConverters" /> | |
</bean> | |
</mvc:argument-resolvers> | |
</mvc:annotation-driven> |
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.springframework.context.annotation.Bean | |
import org.springframework.context.annotation.Configuration | |
import org.springframework.http.converter.ByteArrayHttpMessageConverter | |
import org.springframework.http.converter.HttpMessageConverter | |
import org.springframework.http.converter.StringHttpMessageConverter | |
import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter | |
import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter | |
import org.springframework.http.converter.xml.SourceHttpMessageConverter | |
import org.springframework.http.converter.xml.XmlAwareFormHttpMessageConverter | |
import org.springframework.stereotype.Component |