Ktor Database Beginners Guide
I have been using Ktor, PostgreSQL, and Jetbrains Exposed for a backend in a hobby project. I was adding a new feature that required making changes to the database, so after a quick Google search found a Stackoverflow answer recommending using Flyway to manage the database migrations. I was looking for a more complete solution to this answer, so ended up creating a sample project to share my learnings in migrating a Postgres database with Flyway in a Ktor project.
How to use Firebase Authentication with Ktor 2.0
With the release of Ktor 2.0, one of the migrations I had to do was for Firebase Authentication which I first learned about how to use with Ktor 1.6 from this medium article last year. Learn how to setup Firebase Authentication with Ktor 2.0 and how to test it.
How to track view impressions in a Jetpack Compose Lazy Column
If you have ever shipped a feature with a scrolling list, a product manager will usually ask you to track when an item in that list is viewed by the user. With Jetpack Compose being somewhat new, I was curious how to solve this problem with respect to a LazyColumn
so let’s learn how to know the second eyeballs see items as they scroll into view!
Surviving Android Process Death With SavedStateFlow
I was perusing Reddit the other day when someone asked how they could use SavedStateHandle
with a StateFlow
similar to the SavedStateHandle.getLiveData()
version. The most upvoted comment originally was saying that this functionality is not officially supported, but one could convert the LiveData
to a Flow
using the LiveData.asFlow()
extension function. That seemed pretty simple for anyone to do, however testing that would then require using LiveData
in your tests which might be annoying if you were using StateFlow
to manage state. So after looking over the API, it seemed pretty simple to write a wrapper that could expose this functionality directly as a StateFlow
and that is how the SavedStateFlow library was made!
How to test a custom Android view with Robolectric
Working at an enterprise that needs a custom component library with each component being its own snow flake and having more complicated logic than the next. I found myself needing a way to test the logic in these views to ensure I could iterate quickly and not break anything in the process.
How to build a Slackbot with Kotlin
One day at my day job, I noticed that there were a couple of services we used that anytime an event happened there was a very manual process for the developer to copy paste data into a Slack channel for others to be aware of the issue. I thought there had to be a better way to automate this whole process and prevent a developer from having to do this tedious task. That was when I came up with the idea of creating a Slackbot application to do this. So in this article I will describe the process I went through to create a Slackbot using Ktor and webhooks that can post messages to your Slack channel of choice and how to deploy to Heroku. For this example, we will be using Github webhooks to supply data to our Slackbot but the same principal applies to your service of choice that offers webhooks.
Create a Website with Github Pages
If you have a project, blog, or documentation that you need to have hosted in a site, Github Pages can be a great way to host your site for free straight from the repository.
Physical Workspace
One aspect of a programmer’s work that I think can get overlooked is the actual physical workspace where he or she works. Over the years I have invested a lot of time and effort into creating a home office that is ergonomic and promotes a workflow that works for me. By no means am I trying to tell everyone that…
17 post articles, 3 pages.