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
Spring to JAX-RS Cheat Sheet | |
This is not an exhaustive list, but it does include the most common annotations. | |
Spring Annotation JAX-RS Annotation | |
@RequestMapping(path = "/troopers" @Path("/troopers") | |
@RequestMapping(method = RequestMethod.POST) @POST | |
@RequestMapping(method = RequestMethod.GET) @GET | |
@RequestMapping(method = RequestMethod.DELETE) @DELETE | |
@ResponseBody N/A | |
@RequestBody N/A |
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
- jaxrs-api - This is RESTeasy's packaging of the spec. It is not the official spec jar, but it does adhere to the spec contracts. RESTeasy uses this jar for the entire spec line, i.e. 1.x - current. Though the jar does change internals to adhere to the different JAX-RS versions. | |
- jsr311-api - This is the official spec jar for the JAX-RS 1.x line. | |
- javax.ws.rs-api - This is the official spec jar for the JAX-RS 2.x line. | |
- jersey-core - This is a partial implementation of the spec. The rest of the implementation is contained inside other Jersey jars. Note that in earlier versions of Jersey, they actually packaged the JAX-RS spec APIs into this jar. It wasn't until later that it starting using the official spec jars. |
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
forkJoinPool.submit(() -> | |
range(1, 1_000_000).parallel().filter(PrimesPrint::isPrime) | |
.collect(toList()) | |
).get(); |
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
Kafka Server —>Kafka broker —> Kafka Node refer to the same thing. | |
Kafka Broker | |
A Kafka broker is a Kafka server that hosts topics. | |
Locally start a kafka broker aka kafka server | |
start zookeeper —> {kafka_home}/bin/zookeeper-server-start.sh config/zookeeper.properties | |
start kafka server —> {kafka_home}/bin/kafka-server-start.sh config/server.properties |
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 javax.inject.Inject; | |
@Import(value = {LocalDbAuthConfig.class,CassandraAvailabiltyConfig.class}) | |
@Configuration | |
@EnableRetry | |
@EnableAspectJAutoProxy | |
@EnableDbAuthPropertySupport | |
public class CassandraConfig extends AbstractCassandraConfiguration { |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> | |
<script src="http://fb.me/react-0.12.2.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> |
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
sbt test:compile | |
sbt "test:testOnly *ScenarioModeServiceV1ImplTest" | |
sbt -jvm-debug 9001 | |
>run 9001 | |
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 Order(val qty:Int) | |
enum class BeverageType {COFFEE,TEA} | |
class ChargeManagement | |
{ | |
companion object { |
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 java.math.BigDecimal | |
data class Application(val name:String,val score :BigDecimal) | |
fun main(args:Array<String>) | |
{ | |
val total:BigDecimal = listOf<Application>(Application("a", BigDecimal("100")),Application("b",BigDecimal("100"))) | |
.map( {it.score}) |
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 React from 'react'; | |
import { HashRouter as Router, Switch, Route } from 'react-router-dom'; | |
import SomeTool from '../../containers..'; | |
import SomeComp from '../../containers/..'; | |
const App = () => ( | |
<Router> | |
<Switch> | |
<Route path="/some-tool/:appId" exact component={c} /> | |
<Route path="/some-comp/:id" exact component={SomeComp} /> |