Skip to content

Instantly share code, notes, and snippets.

@rponte
rponte / 1-CustomerCreatedEventSqsConsumer.java
Last active April 29, 2024 13:21
Spring Boot: Testing a @SqsListener with TestContainers and LocalStack
package br.com.zup.edu.app2.xxx.samples.aws.sqs;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.Customer;
import br.com.zup.edu.app2.xxx.samples.aws.sqs.model.CustomerRepository;
import io.awspring.cloud.messaging.listener.SqsMessageDeletionPolicy;
import io.awspring.cloud.messaging.listener.annotation.SqsListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.messaging.handler.annotation.Header;
@dongjinleekr
dongjinleekr / 0-kafka-on-k8s.md
Last active June 29, 2022 11:43
Kafka on Kubernetes, minimal configuration

This gist describes how to create a Kafka cluster on Kubernetes with minimal effort.

Dislike to incubator/kafka helm chart, this approach uses wurstmeister/kafka Docker image or its GraalVM equivalent, dongjinleekr/kafka.

Note: This configuration is intended for dev or testing purpose; it may be used in production environment, but I can't give any guarantees in that respect.

Prerequisites

Install Zookeeper with the following helm command:

@marccarre
marccarre / list_kindle_releases.py
Created October 24, 2020 08:46
List all available versions of Kindle for Mac and Kindle for PC.
#!/usr/bin/env python
'''
List all available versions of Kindle for Mac and Kindle for PC.
Dependencies:
- asyncio==3.4.3
- aiohttp==3.6.3
'''
import os
import sys
@carlosocarvalho
carlosocarvalho / kafka-stack.yaml
Created January 7, 2020 19:07
Kafka file for docker swarm
version: '3.3'
services:
kafka-1:
image: wurstmeister/kafka:1.1.0
environment:
KAFKA_BROKER_ID: '1'
KAFKA_CONTROLLER_SHUTDOWN_ENABLE: 'true'
KAFKA_DEFAULT_REPLICATION_FACTOR: '3'
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: '3000'
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
@cm-kajiwara-taishi
cm-kajiwara-taishi / sam-template.yml
Created December 20, 2019 09:49
lambda-edge-workshops SAM
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
IamLambdaExecutionRoleBasic:
Type: AWS::IAM::Role
Properties:
RoleName: !Sub
- ws-lambda-at-edge-basic-${UniqueId}
- UniqueId: !Select [0, !Split ['-', !Select [2, !Split [ '/', !Ref 'AWS::StackId' ]]]]
@mochadwi
mochadwi / README.md
Created November 21, 2019 11:14
Setup and Install JDK 8, 9, 10 in macOS with Homebrew

Oracle now force user to signup and accept the license agreement in the oracle website.

JDK 8 is still mostly used among java developer especially Android Developer.

Unfortunately, if we're on macOS there's a bad news that the homebrew community delete the entire JAVA/JDk cask and give replacement support to use AdoptOpenJDK.

brew tap adoptopenjdk/openjdk

brew cask install adoptopenjdk8
@rabelais88
rabelais88 / docker-swarm.md
Created November 10, 2019 05:18
스타트업에 traefik + docker-swarm을 추천하는 이유

스타트업에 traefik + docker-swarm을 추천하는 이유

  • Traefik: Reverse-proxy router
  • Docker-swarm: Docker-supported orchestrator

왜 Docker-Swarm인가?

  • kubernetes(이하 k8) 는 무겁고 느리다. docker-swarm(이하 DS)docker 최신버전에 기본으로 탑재되어 나온다. 또한 helm이나 별도의 관리 cli(kubeadm, kubectl)를 설치할 필요가 없다.

  • k8 은 세팅도 어렵다: 세팅하기가 워낙 까다로워 실제로 운영하기 적절한 경우는 devops 팀을 가진 최소 20명 이상의 대규모 사이즈 팀이다. 한 명이 작업하는 것이 아주 불가능한 것은 아니지만, 긴급수정시에는 많이 위험해질 수 있다. 총원이 10명이 되지 않는 우리팀 같은 경우는 한 사람이 급하게 기능수정을 해야될 일이 많다.

@fatihyildizhan
fatihyildizhan / Docker 23 + Traefik 2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Last active October 22, 2023 11:58
Docker 23 + Traefik 2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Docker 23 + Traefik v2.9.10 and v1.7 + Let's Encrypt + Github Registry V2 ghcr.io + Updated on 12 April 2023
Content:
- Ubuntu 22.04
- Docker Engine 23.0.3
- Docker Compose 2.17.2
- Traefik v1.7.18 with dnsChallenge
- Traefik v2.9.9 with httpChallenge
--
- Github Registry V2 ghcr.io
@mikaello
mikaello / group-objects-by-property.md
Last active December 9, 2023 11:15 — forked from JamieMason/group-objects-by-property.md
Group Array of JavaScript Objects by Key or Property Value

Group array of JavaScript objects by keys

This fork of JamieMason's implementation changes the key parameter to be an array of keys instead of just a single key. This makes it possible to group by multiple properties instead of just one.

Implementation

const groupBy = keys => array =>
  array.reduce((objectsByKeyValue, obj) => {
    const value = keys.map(key => obj[key]).join('-');
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
class Destination {
const Destination(this.title, this.icon, this.color);
final String title;
final IconData icon;
final MaterialColor color;
}