#!/bin/sh | |
# dispreset: | |
# When called reset displays to last known arrangement using displayplacer | |
# if called within a timeout period (30 seconds), swap position. | |
# This is to work around the fact that in certain multimonitor configurations | |
# macOS fails to properly ID the displays using serial numbers pulled in via | |
# EDID and so loses track about which monitor is left/right positioned. |
In setting up a Jetty server with Jersey servlets, you may choose to use an embedded Jetty server setup. (See here for how to setup an embedded Jetty server). In this gist, we'll go through how to setup Swagger for this setup. I am using Swagger 1.5, Maven 3.3.3, Jersey 1.8, and Jetty 7.3. Make sure you add all dependencies to your pom.xml.
In the Swagger Core setup, the current official recommendations involve an Application class, or a web.xml, neither of which are used in an embedded Jetty server setup. To add Swagger to your embedded Jetty Server, you must do 3 things:
- Add the package scanning packages to your servlets which will serve your REST API.
- Add the Swagger package scanning servlet.
- P
/* | |
* Copyright (C) 2015 Jake Wharton | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
(function() { | |
var w = window, | |
getRandomAlbum = function() { | |
var albums, r, rAlbum; | |
if (w.location.hash == '#/albums') { | |
albums = document.querySelectorAll('div[data-type="album"]'); | |
r = Math.random(); | |
rAlbum = albums[Math.floor(r * albums.length)]; | |
w.removeEventListener('hashchange', getRandomAlbum, false); | |
w.location.hash = '/album/' + rAlbum.dataset.id; |
https://github.com/mxcl/homebrew/blob/master/Library/Formula/maven.rb defaults to 3.1.0 as of now. Thus similar to https://github.com/Homebrew/homebrew-versions/blob/master/maven2.rb I saved my own formula as a gist (using mxcl/homebrew@b4725ca259a07b85e6bb20c71bcec67b7d457c42 without the detect java patch) to be able to install 3.0.x.
See also brew versions maven
:
3.1.0 git checkout f160fa9 Library/Formula/maven.rb 3.0.5 git checkout b4725ca Library/Formula/maven.rb
public class Preconditions | |
{ | |
/// <summary> | |
/// Ensures that an object reference passed as a parameter to the calling method is not null. | |
/// </summary> | |
/// <param name="reference">an object reference</param> | |
/// <param name="errorMessage">the exception message to use if the check fails</param> | |
/// <returns>the non-null reference that was validated</returns> | |
/// <exception cref="NullReferenceException">if reference is null</exception> | |
public static T CheckNotNull<T>(T reference, string errorMessage) |
#!/bin/bash | |
# | |
# tomcat7 This shell script takes care of starting and stopping Tomcat | |
# | |
# chkconfig: - 80 20 | |
# | |
### BEGIN INIT INFO | |
# Provides: tomcat7 | |
# Required-Start: $network $syslog | |
# Required-Stop: $network $syslog |