Skip to content

Instantly share code, notes, and snippets.

View kldavis4's full-sized avatar

Kelly Davis kldavis4

View GitHub Profile
@kldavis4
kldavis4 / README.markdown
Last active August 29, 2015 14:19 — forked from karmi/.gitignore
Example Nginx Configurations for Elasticsearch

Example Nginx Configurations for Elasticsearch

This repository contains couple of example configurations for using Nginx as a proxy for Elasticsearch.

These examples can be run standalone from this repository -- the general pattern is:

$ nginx -p $PWD/nginx/ -c $PWD/<CONFIG FILE>

When you change the configuration, simply reload the Nginx process to pick up the changes:

@kldavis4
kldavis4 / doit
Created August 28, 2014 18:53 — forked from stantonk/doit
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
yum groupinstall "Development tools"
yum install zlib-devel
yum install bzip2-devel openssl-devel ncurses-devel
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2
tar xf Python-2.7.3.tar.bz2
cd Python-2.7.3
@kldavis4
kldavis4 / responseentity<vertical>.json
Created May 3, 2013 20:30
swagger-springmvc with ResponseEntity<Vertical>
{
"apiVersion": "1.0",
"swaggerVersion": "1.0",
"basePath": "http://localhost:8107/",
"resourcePath": "/vertical-service-controller",
"models": {
"MediaType": {
"name": "MediaType",
"properties": {
"charSet": {
@kldavis4
kldavis4 / responseentity.json
Created May 3, 2013 20:27
swagger-springmvc with plain ResponseEntity
{
"apiVersion": "1.0",
"swaggerVersion": "1.0",
"basePath": "http://localhost:8107/",
"resourcePath": "/vertical-service-controller",
"models": {
"MediaType": {
"name": "MediaType",
"properties": {
"charSet": {
@kldavis4
kldavis4 / test.xml
Created May 1, 2013 20:52
xml output of swagger-springmvc 0.4.2 for controller
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><controllerDocumentation><apiVersion>1.0</apiVersion><apis><description>Operations about verticals</description><operations><deprecated>false</deprecated><httpMethod>GET</httpMethod><nickname>getVertical</nickname><notes></notes><parameters><allowMultiple>false</allowMultiple><dataType>Long</dataType><defaultValue></defaultValue><description>vertical Id</description><name>verticalId</name><notes></notes><paramType>path</paramType><required>false</required></parameters><parameters><allowMultiple>false</allowMultiple><dataType>Boolean</dataType><defaultValue></defaultValue><description>load Children</description><name>loadChildren</name><notes></notes><paramType>query</paramType><required>false</required></parameters><responseClass>ResponseEntity</responseClass><summary>get Vertical</summary></operations><path>/verticals/{verticalId}</path></apis><apis><description>Operations about verticals</description><operations><deprecated>false</deprecated><httpMethod
@kldavis4
kldavis4 / JacksonDeserializationTest3.java
Created January 24, 2013 22:30
Simplified test case to demonstrate issue with JsonIdentityInfo and handling polymorphic classes
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JacksonDeserializationTest3 {
@org.junit.Test
public void test() throws Exception {
Foo foo = new Foo();
@kldavis4
kldavis4 / JacksonDeserializationTest2.java
Created January 24, 2013 22:26
Test case to demonstrate issue with @JsonIdentityInfo and polymorphic classes
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.List;
public class JacksonDeserializationTest2 {
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.ArrayList;
import java.util.List;
public class JacksonDeserializationTest {
@org.junit.Test
@kldavis4
kldavis4 / gist:4488448
Created January 8, 2013 22:08
Test case to replicate issue with handling of polymorphic enum classes
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Test;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.List;