Skip to content

Instantly share code, notes, and snippets.

import com.google.inject.AbstractModule;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.config.ScannerFactory;
import com.wordnik.swagger.jaxrs.config.ReflectiveJaxrsScanner;
import com.wordnik.swagger.jaxrs.listing.ApiListingResource;
import com.wordnik.swagger.jaxrs.listing.SwaggerSerializers;
import com.wordnik.swagger.models.*;
import org.reflections.Reflections;
import java.util.Set;
/**
* A qualifier for the server http port.
*
* @author [email protected] (Ben Manes)
*/
@BindingAnnotation
@Retention(RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER, ElementType.METHOD})
public @interface HttpPort {}
@natros
natros / Jetty 9 + Weld 2 + Jersey 2 + Jackson 2 + Maven
Last active September 17, 2015 16:24 — forked from zach-m/Jetty 9 + Weld 2 + Jersey 2 + Jackson 2 + Maven
Jetty 9 + Weld 2 + Jersey 2 + Jackson 2 + Maven
This is a template for creating and running a Jetty web application, using Jersey + Jackson for REST, and Weld for CDI.
It is organized as a maven project, which builds a WAR file deployable to a standalone Jetty server.
The Jetty maven plugin - which is more suitable for development time - is also configured in the pom.xml.
Comments:
* As Jetty is a servlet-3.0 compatible container, no configuration is needed in web.xml
* Due to a bug in maven, it's required to use version 3.2.2 or above
* The JaxRs API classes are to be placed at the package - or below - the one where 'RestConfig.java' is
* When using in standalone Jetty installation, enable the 'cdi' module before deploying
>> java -jar start.jar --add-to-startd=cdi
@natros
natros / install.sh
Created October 8, 2015 15:54
python cx_Oracle (cx-Oracle) OSX 10.11 El Capitan
cd ~/Library/Python/2.7/lib/
mkdir oracle
cd oracle
export ORACLE_HOME=$PWD
unzip ~/Downloads/instantclient-basic-macos.x64-11.2.0.4.0.zip
unzip ~/Downloads/instantclient-sdk-macos.x64-11.2.0.4.0.zip
mv instantclient_11_2/* .
rmdir instantclient_11_2
ln -s libclntsh.dylib.11.1 libclntsh.dylib
ln -s libocci.dylib.11.1 libocci.dylib
@natros
natros / ..README.md
Created January 21, 2017 10:55 — forked from gnarf/..git-pr.md
Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github origin remote and checks it out
  • git pr 4 upstream - creates local branch pr/4 from upstream remote and checks it out
@natros
natros / dropbox_git.md
Created February 1, 2017 15:36 — forked from trey/dropbox_git.md
Using Dropbox to Share Git Repositories

Using Dropbox to Share Git Repositories

First, create a Git subfolder inside your Dropbox folder. Then you can share the individual projects inside that folder with whomever you want (or just use it for instant offsite backups).

From inside a Git project:

git clone --bare . ~/Dropbox/Git/gitproject.git
git remote add dropbox ~/Dropbox/Git/gitproject.git

When you're ready to push: