Skip to content

Instantly share code, notes, and snippets.

@avall
avall / myfeed.opml
Created July 9, 2024 21:42 — forked from dracarys18/myfeed.opml
Tech Blogs I am following
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.1" xmlns:feeder="https://nononsenseapps.com/feeder">
<head>
<title>
Feeder
</title>
</head>
<body>
<outline title="Companies" text="Companies">
<outline feeder:notify="false" feeder:imageUrl="https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png" feeder:fullTextByDefault="false" feeder:openArticlesWith="" feeder:alternateId="false" title="The Netflix Tech Blog" text="The Netflix Tech Blog" type="rss" xmlUrl="http://techblog.netflix.com/feeds/posts/default"/>
@avall
avall / README-00001.md
Created June 25, 2024 09:51
Example of a gist

Hello World

@avall
avall / work-with-multiple-github-accounts.md
Created January 27, 2023 11:18 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@avall
avall / generate-certificate-chain.sh
Created August 19, 2022 08:23 — forked from granella/generate-certificate-chain.sh
Create self-signed certificate with root and ca for development
#!/bin/bash
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
echo "===================================================="
# generate private keys (for root and ca)
@avall
avall / application.yml
Created February 21, 2022 11:25
How to log (trace) Spring Cloud Gateway (3.0.6)
spring:
application:
name: sample
profiles:
active: dev
cloud:
gateway:
actuator:
verbose:
enabled: false
@avall
avall / gist:f56b140fa5ec7204bd8efb732210d5d1
Created February 21, 2022 11:18
How to debug that Spring Boot (concrete) Bean is loaded correctly.
// Debug into the class
// org.springframework.beans.factory.support
// DefaultSingletonBeanRegistry
// method
// public Object getSingleton
try {
singletonObject = singletonFactory.getObject();
// add condition 'beanName.indexOf("routesConfig") >= 0'
@avall
avall / gist:4b40a5801495cc077570156bbc71dc53
Created February 21, 2022 11:16
How to manage Spring Boot 'additional-location' to load properties (intellij run)
'routes.yml' are more properties for Spring Cloud Gateway, for example.
VM options add:
-Dspring.config.additional-location=file:config/routes.yml
@Configuration
class ExtraConfig() {
@Bean
fun extraBean(
@avall
avall / gist:00ab104711bad6506d4c8980c81bc3c5
Created January 23, 2022 20:03
Kotlin - OffsetDateTime to Instant
fun toInstant(input: OffsetDateTime): Instant? {
return input.atZoneSameInstant(ZoneOffset.UTC).toInstant()
}
toInstant(OffsetDateTime.of(2021, 12, 31,0,0,0,0, ZoneOffset.UTC))
@avall
avall / KafkaProducerTest.java
Created October 19, 2021 14:38 — forked from itzg/KafkaProducerTest.java
Using embedded Kafka in Spring Boot unit test
import static org.junit.Assert.assertThat;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasKey;
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
import static org.springframework.kafka.test.utils.KafkaTestUtils.getSingleRecord;
import java.util.Map;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.common.serialization.Deserializer;
@avall
avall / asyncForEach.ts
Created August 11, 2021 17:06
transform "forEach" to async
export async function asyncForEach<T>(array: Array<T>, callback: (item: T, index: number) => void) {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index);
}
}