Skip to content

Instantly share code, notes, and snippets.

View sgyyz's full-sized avatar
🎯
Focusing

Yongzhi Yang sgyyz

🎯
Focusing
View GitHub Profile
@sgyyz
sgyyz / gulp-ng-config.md
Last active January 13, 2017 14:27
Building angularjs configuration file by gulp-ng-config

gulp-ng-config

In our angularjs app, we usually call remote API to get data to make our app live. But we will have different environment for our app when we develop it or put it online. So we will meet the requirement to build our app for different environemnts. How to deal with it when you use gulp to build your app?

Yes, gulp-ng-config can help you to do it easily.

Introduction of gulp-ng-config

You can refer https://www.npmjs.com/package/gulp-ng-config to get more details of this plugin.

Install gulp-ng-config

Under your package.json file path,

@sgyyz
sgyyz / pom.xml
Created February 1, 2019 07:10
email-spring-boot-starter dependency
<dependency>
<groupId>io.57blocks</groupId>
<artifactId>email-spring-boot-starter</artifactId>
<version>0.1.3</version>
</dependency>
@sgyyz
sgyyz / application.yml
Created February 1, 2019 07:11
email-spring-boot-starter spring mail configuration
spring.mail:
host: email-smtp.us-west-2.amazonaws.com
username: username
password: password
properties:
mail.transport.protocol: smtp
mail.smtp.port: 25
mail.smtp.auth: true
mail.smtp.starttls.enable: true
mail.smtp.starttls.required: true
@sgyyz
sgyyz / pom.xml
Created February 2, 2019 02:49
aws ses dependency
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-aws</artifactId>
<version>2.0.1.RELEASE</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ses</artifactId>
<version>1.11.415</version>
@sgyyz
sgyyz / application.yml
Created February 2, 2019 02:50
aws cloud spring-boot configuration
cloud:
aws:
region:
static: us-east-2
credentials:
accessKey: accessKey
secretKey: secretKey
@sgyyz
sgyyz / resource-layout.txt
Created February 2, 2019 02:52
email-spring-boot-starter resource layout
email
├── html
│   └── greeting.html
├── messages.properties
├── messages_zh.properties
├── subject
│   └── greeting.txt
└── text
└── greeting.txt
@sgyyz
sgyyz / application.yml
Created February 2, 2019 02:53
email-spring-boot-starter default configuration
io.57blocks.email:
enabled: false
template:
prefix: /email/
message_base_name: messages
html:
pattern: html/*
suffix: .html
character_encoding: UTF-8
cacheable: false
@sgyyz
sgyyz / GreetingService.java
Created February 2, 2019 02:54
email-spring-boot-starter example
public class GreetingService {
@Autowired
private EmailService emailService;
public void sendEmail() {
try {
Map<String, Object> ctx = ImmutableMap.of("name", "Mr. Smith");
emailService.sendHtmlMail("Sender <sender@somecompany.com>", "greeting", Locale.CHINESE, ctx, "Mr. Smith <smith@somedomain.com>");
} catch (MessagingException e) {
# The version of Alpine to use for the final image
# This should match the version of Alpine that the `elixir:1.7.2-alpine` image uses
ARG ALPINE_VERSION=3.8
FROM elixir:1.7.2-alpine AS builder
# The following are build arguments used to change variable parts of the image.
# The name of your application/release (required)
ARG APP_NAME
# The version of the application we are building (required)
$ docker build --build-arg APP_NAME=dockerize_elixir --build-arg APP_VSN=0.1.0 --build-arg SKIP_PHOENIX=true -t app:0.1.0 .