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 antifusion; | |
import mock.itsm.CreateIncident; | |
import mock.netcool.UpdateIncident; | |
import org.eclipse.jetty.http.spi.JettyHttpServerProvider; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.handler.ContextHandlerCollection; | |
import org.eclipse.jetty.server.handler.HandlerCollection; | |
import org.eclipse.jetty.webapp.WebAppContext; |
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 static ConstrettoConfig create() { | |
ConstrettoConfiguration config = new ConstrettoBuilder(). | |
createIniFileConfigurationStore(). | |
addResource(Resource.create("classpath:config.ini")). | |
addResource(Resource.create("file:/etc/wholesale/config.ini")) | |
.done().createSystemPropertiesStore().getConfiguration(); | |
return new ConstrettoConfig(config); | |
} |
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.apache.velocity.app.Velocity | |
import org.apache.velocity.VelocityContext | |
import java.io.StringWriter | |
public class VelocityRenderer { | |
public String render(Map<String, String> map, String resource) { | |
StringWriter stringWriter = new StringWriter(); | |
VelocityContext context = new VelocityContext(map); |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<jboss-web> | |
<context-root>/some-context-path</context-root> | |
<security-domain>ldap</security-domain> | |
<valve> | |
<class-name>org.apache.catalina.authenticator.BasicAuthenticator</class-name> | |
<param> | |
<param-name>disableProxyCaching</param-name> | |
<param-value>false</param-value> | |
</param> |
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 CalculateAndWrap[A, B](f: (A) => B) { | |
def unapply(input: A): Option[(A,B)] = Some(input -> f(input)) | |
} | |
val StringAndLength = new CalculateAndWrap((s: String) => s.length) | |
"foo" match { | |
case StringAndLength((f,l)) => println(f + " length " + l) | |
} |
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 net.hamnaberg.json.parser.CollectionParser; | |
import net.hamnaberg.funclite.Function; | |
import net.hamnaberg.funclite.FunctionalList; | |
import net.hamnaberg.funclite.Optional; | |
import org.apache.http.HttpResponse; | |
import org.apache.http.client.ResponseHandler; | |
import org.apache.http.client.methods.HttpGet; | |
import org.apache.http.impl.client.DefaultHttpClient; | |
import java.io.IOException; |
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
#!/bin/bash | |
sudo sh -c 'echo "deb http://repository.spotify.com stable non-free" > /etc/apt/sources.list.d/spotify.list' | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59 | |
sudo apt-get update | |
sudo apt-get install spotify-client |
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
libraryDependencies ++= { | |
val libVersion = "0.6.8" | |
Seq("net.databinder" % "unfiltered-filter" % libVersion, "net.databinder" % "unfiltered-directives" % libVersion) | |
} |
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 ems | |
import javax.servlet.http.HttpServletRequest | |
import org.joda.time.DateTime | |
import unfiltered.directives._ | |
import Directives._ | |
import unfiltered.request._ | |
import unfiltered.response._ | |
import unfilteredx._ |
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
POST /events/{id}/sessions/{sessionId} | |
Content-Type: application/x-www-form-urlencoded | |
tag=ja&tag=kommer&tag=speakers_dinner_2013 | |
200 OK | |
Content-Type: application/vnd.collection+json | |
{ |