Skip to content

Instantly share code, notes, and snippets.

@andreybleme
andreybleme / bootstrap.properties
Created August 16, 2019 02:18
andreybleme.com | Centralized configuration with Spring Cloud Config
encrypt.key=my-crazy-key
@andreybleme
andreybleme / bootstrap.properties
Last active August 16, 2019 02:16
andreybleme.com | Centralized configuration with Spring Cloud Config
spring.application.name=crazy-client
spring.profiles.active=production
spring.cloud.config.uri=http://localhost:8888
@andreybleme
andreybleme / crazy-client-production.properties
Created August 16, 2019 02:14
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme-prod:password123prod@andreybleme.com:5432/my-prod-database
@andreybleme
andreybleme / crazy-client-development.properties
Created August 16, 2019 02:13
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme-dev:password123dev@andreybleme.com:5432/my-dev-database
@andreybleme
andreybleme / DatabaseController.java
Created August 16, 2019 02:09
andreybleme.com | Centralized configuration with Spring Cloud Config
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
class DatabaseController {
@Value("${url}")
@andreybleme
andreybleme / bootstrap.properties
Created August 16, 2019 02:07
andreybleme.com | Centralized configuration with Spring Cloud Config
spring.application.name=crazy-client
spring.cloud.config.uri=http://localhost:8888
@andreybleme
andreybleme / crazy-client.properties
Created August 16, 2019 02:06
andreybleme.com | Centralized configuration with Spring Cloud Config
url=postgres://andreybleme:password123@andreybleme.com:5432/mydatabase
@andreybleme
andreybleme / application.properties
Created August 16, 2019 02:01
andreybleme.com | Centralized configuration with Spring Cloud Config
server.port=8888
spring.cloud.config.server.git.uri=https://github.com/andreybleme/discovering-spring-cloud-configserver
@andreybleme
andreybleme / DiscoveringConfigServerApplication.java
Created August 16, 2019 01:55
andreybleme.com | Centralized configuration with Spring Cloud Config
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.config.server.EnableConfigServer;
@EnableConfigServer
@SpringBootApplication
public class DiscoveringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(DiscoveringConfigServerApplication.class, args);
@andreybleme
andreybleme / exemplo3.c
Last active July 24, 2019 21:59
andreybleme.com | O que é Memory Safety
/* Programa 3 */
struct foo {
int x;
int y;
char *pc;
};
struct foo *pf = malloc(...);
pf->x = 5;