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/bash | |
export COMPOSE_PROJECT_NAME=franceremote | |
docker context use default | |
docker-compose build || exit 1 | |
docker-compose push || exit 1 | |
docker context use fr | |
docker-compose pull || (docker context use default && exit 1) | |
docker-compose up -d || (docker context use default && exit 1) | |
docker-compose logs -f web | |
docker context use default |
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
version: '3.4' | |
x-logging: &logging | |
logging: | |
driver: "json-file" | |
options: | |
max-size: 10M | |
max-file: 1 | |
services: | |
fluentd: | |
image: $INTERNAL_REGISTRY/fluentd |
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
FROM openjdk:10-jdk-slim | |
RUN apt-get update && apt-get install -y curl | |
ENV jvm_args "" | |
RUN mkdir -p /usr/src/agent | |
WORKDIR /usr/src/agent | |
RUN curl -s --output apm-agent.jar https://search.maven.org/remotecontent?filepath=co/elastic/apm/apm-agent-attach/1.6.1/apm-agent-attach-1.6.1.jar | |
ARG jar_name | |
WORKDIR /usr/src/api | |
COPY ./application-api-purchase-restapi/build/libs/${jar_name}.jar application.jar | |
CMD java -jar /usr/src/agent/apm-agent.jar --continuous --args 'service_name=api;server_urls=http://kibana-apm-server:8200' & \ |
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
/** | |
* The security configuration. | |
* <P> | |
* @author Pangee. | |
* @version 1.0.0-SNAPSHOT | |
*/ | |
@Configuration | |
@EnableWebSecurity | |
@EnableRedisHttpSession | |
@EnableGlobalMethodSecurity(prePostEnabled = true) |
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 Record | |
{ | |
public DateTime Start; | |
public DateTime End; | |
public long Id; | |
public TimeSpan Duration => End - Start; | |
private static long[] _pows = Enumerable.Range(0, 8).Select(i => (long)Math.Pow(10, i)).ToArray(); | |
public Record(string line) | |
{ |
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 FakeMyDbContext : IMyDbContext | |
{ | |
public FakeMyDbContext(IEnumerable<Customer> customers ) | |
{ | |
Customers = customers.AsQueryable(); | |
} | |
public IQueryable<Customer> Customers { get; set; } | |
} |
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 CustomerController : Controller | |
{ | |
private IMyDbContext _dbContext; | |
public CustomerController(IMyDbContext dbContext) | |
{ | |
_dbContext = dbContext; | |
} | |
public ActionResult Index() |
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 CustomerController : Controller | |
{ | |
private MyDbContext _dbContext; | |
public ActionResult Index() | |
{ | |
return View(_dbContext.Customers.OrderBy(c => c.Name).ToList()); | |
} | |
} | |
public class MyDbContext : DbContext | |
{ |
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 Program | |
{ | |
public static void Main(params object[] para) | |
{ | |
//ninject bootstrapping | |
var standardKernel = new StandardKernel(); | |
standardKernel.Bind<DbContext>().To<DbContext>(); | |
standardKernel.Bind<MessageProcessor>().To<MessageProcessor>(); | |
MessageProcessor messageProcessor = standardKernel.Get<MessageProcessor>(); | |
//link the commands with their handlers, and the events with their observers |
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 Product | |
{ | |
public string Name { get; set; } | |
public int Id { get; set; } | |
public decimal Price { get; set; } | |
} | |
public class Order | |
{ | |
public int Id { get; set; } |
NewerOlder