Skip to content

Instantly share code, notes, and snippets.

@cheonvi1004
cheonvi1004 / Messages.java
Created December 4, 2017 06:27 — forked from jonikarppinen/Messages.java
Example of using message resources in Spring Boot service layer code, in as simple way as possible (hopefully!)
package com.company.project.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Locale;
@cheonvi1004
cheonvi1004 / Messages.java
Created December 4, 2017 06:27 — forked from jonikarppinen/Messages.java
Example of using message resources in Spring Boot service layer code, in as simple way as possible (hopefully!)
package com.company.project.components;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Locale;
@cheonvi1004
cheonvi1004 / promises.md
Created November 17, 2017 13:02 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.