Skip to content

Commit

Permalink
final pass
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenPG committed Oct 5, 2024
1 parent 548b8db commit 38bbdd8
Show file tree
Hide file tree
Showing 14 changed files with 50 additions and 93 deletions.
4 changes: 2 additions & 2 deletions astro/astro-paper-main/doc-posts/astro-paper-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pubDatetime: 2023-01-30T15:57:52.737Z
title: AstroPaper 2.0
slug: astro-paper-2
featured: false
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png
ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- release
description: AstroPaper with the enhancements of Astro v2. Type-safe markdown contents, bug fixes and better dev experience etc.
Expand All @@ -14,7 +14,7 @@ Astro 2.0 has been released with some cool features, breaking changes, DX improv

<!-- ![Introducing AstroPaper 2.0](https://user-images.githubusercontent.com/53733092/215683840-dc2502f5-8c5a-44f0-a26c-4e7180455056.png) -->

![Introducing AstroPaper 2.0](https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png)
![Introducing AstroPaper 2.0](https://i.imgur.com/4ICZldG.jpeg)

## Table of contents

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-09-19T12:00:00.000Z
title: Easy Spring Rest Client w/ OAuth2
slug: spring-rest-client-oauth2
featured: true
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-04-13T12:00:00.000Z
title: GraalVM Native Image Reflect Config Demystified
slug: graalvm-reflect-config-demystified
featured: true
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand All @@ -21,7 +21,7 @@ of the java magic that would be happening in a JVM environment, that isn't avail

When we do a nativeCompile, some native-image metadata is generated by the build process. But it can only see
what information is available at build-time. The recommended way of generating the additional data that isn't
available at build-time is by using the `tracing-agent`. It's [fairly documented here on the official GraalVM site](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)
available at build-time is by using the `tracing-agent`. It's [fairly well documented here on the official GraalVM site](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)

There is a major downside to this tracing-agent process; lets say we have a native-image application with a dozen
api endpoints using spring-web-mvc. When a developer updates the application and adds a new endpoint, the metadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-07-21T12:00:00.000Z
title: Homelab Drives & Buying Used
slug: buying-used-harddrives
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- hardware
description: An article with a short overview of my experiece buying used drives and using smartctl.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-09-29T12:00:00.000Z
title: Jdk 23 Streams - How To Use Gather Operations
slug: jdk23-streams-gather
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-03-05T12:00:00.000Z
title: Logging Request Body with Spring WebClient
slug: request-body-with-spring-webclient
featured: true
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-03-04T12:00:00.000Z
title: Converting Spring Boot 2 to Spring Boot 3 Native Image w/ GraalVM
slug: spring2-to-spring3-graalvm
featured: true
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- story
- spring boot
Expand Down
62 changes: 11 additions & 51 deletions astro/astro-paper-main/src/content/blog/my-first-post.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,27 @@ pubDatetime: 2024-02-04T12:00:00.000Z
title: My First Post, on My First Blog
slug: my-first-post
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- story
- tech
description: My first blog post, describing the original Jekyll blog and a migration to Astro.
---

## The Hook

TODO - update with Astro migration

What do I write on my first post under the "Tech Posts" section of this blog? It's gotta be something
tech related... And the only thing on my mind is this blog made with Jekyll. So I'll write a little
bit about my setup and Jekyll!

TODO - replace this with Astro migration, keep jekyll stuff

## How these pages were built

Shout-out to [Chad Baldwin][chadbaldwin.net], who's blog I came across when I started searching on how to
get this Jekyll thing up off the ground. He created a really cool bootstrapping github template that I
planned on using, but I like to understand tools by messing with them myself.

His site was the inspiration for this one!

So I jumped over to [Jekyll's Install][jekyll-install] and got it installed on my Mac.

Speaking of my local machine, I do nearly all of my work on a steeply discounted Apple M1 Pro I picked up
right when the M2 Pro released.

![Image of Directory](/assets/LvdGYAG.jpg)

In the spirit of open source, I've been cross referencing Chad's blog
and the official Jekyll documentation.

Once I got everything installed, I kicked off the process with `gem install jekyll` and
got to creating!

## Building the Blog

As soon as I had jekyll installed, I ran `bundle exec jekyll serve`. This created
a _site and .jekyll-cache and started serving my site locally.

I quickly found myself in over my head at this point, and went through the step by step
tutorial available [on jekyll's docs page](https://jekyllrb.com/docs/step-by-step/01-setup/)
## The Origins

From there, I created a _layouts folder and set up the format
I wanted by default (default.html), and for my home page (home.html).
This is actually the second iteration of my blog, the first was built using Jekyll. That worked pretty well until I started wanted to configure the themes... things started to get a little hairy if you went
outside the template, and I found myself creating a new template.

[The layout docs are right here](https://jekyllrb.com/docs/step-by-step/04-layouts/)
I started digging and found Astro! It looks like Astro is used by a TON of companies, and plenty of bloggers, so I figured I'd try it out.

![Image of Directory](/assets/44wMq0Z.png)
It's pretty simple, and I do a lot of React for work so I was pretty comfortable!

I followed the instructions in the Blogging section of the step-by-step and took some
inspiration from Chad's repository, and separated my posts into personal and tech.
My original blog was a carbon copy of the template set up by Chad Baldwin, who has his template running for his own blog at chadbaldwin.net, so shout-out to him for getting me started!

As of this post, that's where I am now!
THIS blog is built off of astro-paper, repo available here: https://github.com/satnaing/astro-paper

I'll be updating the site, and everything (including all my commits and history) will be
available [in the github repository that serves this site!](https://github.com/StevenPG/coding-steve)
It was extremely simple to convert everything and I'm happier with the customizability AND the default layout.

[chadbaldwin.net]: https://chadbaldwin.net
[jekyll-install]: https://jekyllrb.com/docs/installation/macos/
There's still a lot to learn about Astro, but I'm ready to dive in a document it all! (And everything else I wish I'd found online)
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-06-05T12:00:00.000Z
title: Partitioning Tables with Progress
slug: partitioning-tables-postgres
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-08-04T12:00:00.000Z
title: Spring Cloud Stream's RecordRecoverableProcessor for Workflow Error Handling
slug: scs-record-recoverable-processor
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- software
- spring boot
Expand Down Expand Up @@ -57,8 +57,7 @@ spring:
##### Minimal Java Code
{% highlight java %}
```java
@SpringBootApplication
public class SpringCloudStreamExample {

Expand All @@ -78,7 +77,7 @@ public class SpringCloudStreamExample {
return input -> input.filter(value -> value != null);
}
}
{% endhighlight %}
```

This minimal code example does a simple null check and passes the message from the in-0 configuration
to the out-0 configuration. The framework comes with a TON of sensible default values, so a basic configuration is all
Expand All @@ -96,7 +95,7 @@ To manage exceptions, we were forced to wrap every processing step in a try-catc

A common workaround was to return Optional values from processing components and filter out errors. However, this approach introduced its own set of challenges, including type inference issues and a less-than-ideal developer experience.

{% highlight java %}
```java
// Pseudocode
@Bean
public Function<KStream<String, String>, KStream<String, String>> readAndPublish() {
Expand All @@ -110,7 +109,7 @@ public Function<KStream<String, String>, KStream<String, String>> readAndPublish
.process(sometOtherOtherMethod::returnsOptional3)
.filter(optional -> optional.isPresent())
}
{% endhighlight %}
```

Implementing a Dead Letter Queue (DLQ) was also a manual nightmare. While the framework offered DLQ capabilities for deserialization errors, there was no out-of-the-box solution for processing errors.

Expand All @@ -136,7 +135,7 @@ Both operate on a similar concept.

This is the main body of the [RecordRecoverableProcessor][rrp]:

{% highlight java %}
```java
try {
// The delegate function is the function passed into the processor
Record<KOut, VOut> downstreamRecord = this.delegateFunction.apply(record);
Expand All @@ -159,9 +158,6 @@ through the stream, and no exception is propagated.
Below are examples of each of the two new components:

#### DltAwareProcessor

{% highlight java %}

@Bean
public Function<KStream<UUID, String>, KStream<UUID, String>> dltAwareExample(
DltPublishingContext dltPublishingContext) {
Expand All @@ -170,17 +166,15 @@ public Function<KStream<UUID, String>, KStream<UUID, String>> dltAwareExample(
throw new RuntimeException("Something went wrong, Error");
}, "my.dead-letter-queue.topic", dltPublishingContext));
}

{% endhighlight %}
```

#### RecordRecoverableProcessor

Here is a sample RecordRecoverableProcessor, fully laid out. An IDE will suggest turning many parts
of this example into lambda functions, making it significantly cleaner. I will link both here to show what exactly
is happening with the expanded version, but also how short it can be with the cleaned up version.

{% highlight java %}

```java
// Expanded version
@Bean
public Function<KStream<String, String>, KStream<String, String>> rrpDemo(){
Expand Down Expand Up @@ -217,9 +211,7 @@ public Function<KStream<String, String>, KStream<String, String>> rrpDemo(){
)
));
}

{% endhighlight %}

```


### Finally
Expand Down
12 changes: 8 additions & 4 deletions astro/astro-paper-main/src/content/blog/the-cat-door.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pubDatetime: 2024-02-06T12:00:00.000Z
title: Freedom of Travel for the Three Legged Cat
slug: tripod-travel-freedom
featured: false
# TODO replace ogImage
ogImage: https://user-images.githubusercontent.com/53733092/215771435-25408246-2309-4f8b-a781-1f3d93bdf0ec.png

ogImage: https://i.imgur.com/4ICZldG.jpeg
tags:
- story
- cats
Expand Down Expand Up @@ -55,8 +55,12 @@ I can tell he's proud of himself afterward, because he acts a lot more energetic
The most important part about this door though, is that only the two or three cats that can be trusted (not to destroy everything)
are registered via microchip to get into the office.

I occasionally spot the other cats peeking in, jealous of the special portal that only allows in select creatures. It has to
appear as magic to them, and I know some of them have attempted to open the door, only to find it locked and unable to be opened.
I occasionally spot the other cats peeking in, jealous of the special portal that only allows in select creatures.

![Image of Cats looking at each other through the cat door](/assets/v9EGGek.jpeg)


It has to appear as magic to them, and I know some of them have attempted to open the door, only to find it locked and unable to be opened.

![Image of Cat peeking through cat door](/assets/EZb9cQ7.jpg)

Expand Down
4 changes: 2 additions & 2 deletions astro/astro-paper-main/src/pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ layout: ../layouts/AboutLayout.astro
title: "About"
---

I'm a senior software developer with about X years of experience (todo, automate that!) doing devops and developement work.
Hi, I'm Steve. I like 3d printing, have 11 cats with my wife, and really enjoy working with new technology.

I've worked in retail, tax software and aerospace industries, and in all of those positions I was always pushing the limit
as far as I could. Always trying to use bleeding edge tools where I can!

Expand All @@ -13,7 +14,6 @@ a mountain of research, I write about it here! Similarly, a lot of articles and

I hate that, so I aim for my posts to actually be useful to whoever comes across them! (Or me, 6 months from now)

TODO - replace this image!
<div>
<img src="/assets/dev.svg" class="sm:w-1/2 mx-auto" alt="coding dev illustration">
</div>
Expand Down
3 changes: 2 additions & 1 deletion astro/astro-paper-main/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const featuredPosts = sortedPosts.filter(({ data }) => data.featured);
const recentPosts = sortedPosts.filter(({ data }) => !data.featured);
const socialCount = SOCIALS.filter(social => social.active).length;
const yoe = new Date().getFullYear() - 2016;
---

<Layout>
Expand All @@ -42,7 +43,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
</a>

<p>
I'm a senior software developer with about X years of experience (todo, automate that!) doing devops and developement work.
I'm a senior software developer with about {yoe} years of experience doing devops and developement work.
This is my blog where I write posts I wish I had found online myself.
</p>
{
Expand Down

0 comments on commit 38bbdd8

Please sign in to comment.