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.junit.After; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| import org.junit.runner.RunWith; | |
| import org.mockito.Mockito; | |
| import org.powermock.api.mockito.PowerMockito; | |
| import org.powermock.core.classloader.annotations.PrepareForTest; | |
| import org.powermock.modules.junit4.PowerMockRunner; | |
| import java.util.HashMap; |
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
| name := "Scala_Language" | |
| version := "1.0" | |
| scalaVersion := "2.11.5" | |
| libraryDependencies ++= Seq( | |
| "com.typesafe" % "config" % "1.3.0", | |
| "org.scalatest" % "scalatest_2.11" % "2.2.6" % "test" |
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 com.ssir.ironman; | |
| import javax.ws.rs.ext.ContextResolver; | |
| import org.glassfish.jersey.server.ResourceConfig; | |
| import org.glassfish.jersey.server.ServerProperties; | |
| import org.springframework.stereotype.Component; | |
| import com.fasterxml.jackson.annotation.JsonInclude; | |
| import com.fasterxml.jackson.databind.ObjectMapper; |
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 com.ssir.ironman; | |
| import org.glassfish.jersey.server.ResourceConfig; | |
| import org.glassfish.jersey.server.ServerProperties; | |
| import org.springframework.stereotype.Component; | |
| import io.swagger.jaxrs.config.BeanConfig; | |
| import io.swagger.jaxrs.listing.ApiListingResource; | |
| import io.swagger.jaxrs.listing.SwaggerSerializers; |
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 class CORSResponseFilter implements ContainerResponseFilter { | |
| @Override | |
| public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) | |
| throws IOException { | |
| final int ACCESS_CONTROL_MAX_AGE_IN_SECONDS = 12 * 60 * 60; | |
| MultivaluedMap<String, Object> headers = responseContext.getHeaders(); | |
| headers.add("Access-Control-Allow-Origin", "*"); // "*" means the request can come from any domain |
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.sql.{Connection,DriverManager} | |
| import com.typesafe.scalalogging._ | |
| import org.slf4j.LoggerFactory | |
| object MysqlJDBC extends App { | |
| val logger = Logger(LoggerFactory.getLogger(this.getClass)) | |
| val url = "jdbc:mysql://10.120.136.90:3306/hackpad" | |
| val driver = "com.mysql.jdbc.Driver" |
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.util.concurrent.TimeUnit; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| public class App { | |
| private static final Logger logger = LoggerFactory.getLogger(App.class); | |
| public static void main(String[] args) { |
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
| @JsonInclude(JsonInclude.Include.NON_NULL) // Class level | |
| @Document(collection = "Project") | |
| public class Project extends AbstractDocument { | |
| private String name; | |
| private String serialNumber; | |
| private Double updatedAt; | |
| @DBRef | |
| private Customer customer; |
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
| [Unit] | |
| Description=MongoDB Database Service | |
| Requires=syslog.target network.target | |
| After=syslog.target network.target | |
| [Service] | |
| Type=forking | |
| PIDFile=/data2/mongo3.2/mongod.pid | |
| ExecStart=/data2/mongo3.2/runMongod.sh | |
| ExecReload=/bin/kill -HUP $MAINPID |
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
| > db.getUsers() | |
| [ | |
| { | |
| "_id" : "admin.ssir-admin", | |
| "user" : "ssir-admin", | |
| "db" : "admin", | |
| "roles" : [ | |
| { | |
| "role" : "readWrite", | |
| "db" : "admin" |
OlderNewer