This file contains 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 akka.actor._ | |
import akka.util.Timeout | |
import concurrent.{Promise, Future, Await} | |
import concurrent.util.Duration | |
import concurrent.util.duration._ | |
import collection.mutable.ListBuffer | |
import akka.pattern.after | |
import concurrent.ExecutionContext | |
import java.util.concurrent.{Executor, Executors} | |
import sys.process._ |
This file contains 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"?> | |
<project | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" | |
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.example</groupId> | |
<artifactId>api</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<packaging>war</packaging> | |
<dependencies> |
This file contains 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
<plugin> | |
<groupId>org.apache.cxf</groupId> | |
<artifactId>cxf-wadl2java-plugin</artifactId> | |
<version>2.7.5</version> | |
<configuration> | |
<sourceRoot>${basedir}/src/main/java</sourceRoot> | |
<wadlOptions> | |
<wadlOption> | |
<wadl>${basedir}/src/test/resources/sample.wadl</wadl> | |
<impl>true</impl> |
This file contains 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.sample.dojo</groupId> | |
<artifactId>sample</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>sample</name> |
This file contains 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
409 Conflict | |
{ | |
"status": 409, | |
"code": 40924, | |
"property"; "name", | |
"message": "A Directory named 'Avengers' already exists", | |
"developerMessage": "A directory named 'Avengers' already exists. If you have a stale local cache, please expire it now", | |
"moreInfo": "http//example.com/docs/api/errors/40924" | |
} |
This file contains 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 class FizzBuzz { | |
static java.util.function.Predicate<Integer> divBy(int n) { return i -> (i % n) == 0;} | |
static String fizzBuzz(Integer intIn){ | |
String fizz = divBy(3).test(intIn) ? "Fizz" : ""; | |
String buzz = divBy(5).test(intIn) ? "Buzz" : ""; | |
return (fizz.isEmpty() && buzz.isEmpty()) ? intIn.toString() : fizz + buzz; | |
} |
This file contains 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
@Path("/books") | |
public class BookResource { | |
// less bandwidth | |
@GET | |
@Path("/{id}") | |
public Response getBook(@PathParam("id") long id, @Context Request request){ | |
Book myBook = getBookFromDB(id); | |
CacheControl cc = new CacheControl(); |
This file contains 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/sh | |
# NOTES: | |
# - This script takes only one argument (desired path to create the app) | |
# - It uses uses coffeescript, stylus and jade to as sample files/code | |
# - Its intended to be just an example for getting started, and nothing more | |
# - For more info on Polvo, check the project Site and README: | |
# http://polvo.io | |
# https://github.com/polvo/polvo |
This file contains 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
// Thanks Daniel Soro @dvlc_ | |
public void contributeToOpenSource() { | |
boolean stillInterestedAndHavingFun = true; | |
int taskSize = 1; // start small! | |
contributing: | |
while (stillInterestedAndHavingFun) { | |
Task task = findSomethingInteresting(taskSize++); | |
if (!task.hasJira()) { | |
createJira(task); | |
} else { |
This file contains 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
<properties> | |
<maven.compiler.target>1.7</maven.compiler.target> | |
<maven.compiler.source>1.7</maven.compiler.source> | |
<maven.compiler.testTarget>1.8</maven.compiler.testTarget> | |
<maven.compiler.testSource>1.8</maven.compiler.testSource> | |
</properties> |
OlderNewer