Deploying Hugo to S3 With GitHub Actions Feb 13, 2024 I’ve previously used AWS CodeBuild to build and deploy Hugo on S3, and that worked, but recently I started using GitHub Actions for work, and it looked much easier than AWS CodeBuild. I’ve migrated to GitHub Actions in about an hour with a couple of failures, but that was easy enough to fix. Here’s how to do that yourself. Create IAM user for S3 access Go to AWS IAM (Identity and Access Management), on the left side go to users and then click Create user button. ...
Spring @Value Annotation in Kotlin Throws an Error Must Be a Compile-Time Constant May 26, 2022 Continuing on some short posts from the Spring project I’m working on, I’ve got stuck a bit with injecting a value from properties file with @Value annotation. The following code didn’t work: @Component class Example( @Value("${property.from.properties.file}")) private val property: String, ) { //... } The error I was getting was: An annotation argument must be a compile-time constant Looking at the code from Spring, it’s clear that I was writing the correct code. ...
Removing the ROLE_ Prefix in Spring Security May 11, 2022 In this post we're going to look at why there's a prefix ROLE_ in Spring Security and how to remove it ...
Ktor CORS doesn't allow requests Jul 30, 2021 I’ve stumbled upon issue with Ktors CORS feature that I couldn’t solve that fast, required a lot of googling and everything on stackoverflow showed that my requests were correct, but they weren’t for Ktor. ...
Why Is Java Not Showing Full Stacktrace Jun 21, 2020 Few weeks ago I got a recommendation from a colleague to read Effective Java. It’s insightful book with many great tips, some of which I’ve been using by default because IntelliJ is hinting me to do that, however most of the tips were new to me. One paragraph stated that “exceptions are expensive operations to throw, because they require the whole stacktrace to be captured”. It seems logical and that’s something I remembered. ...
Java mTLS Http Client Nov 3, 2019 A guide on how to implement Java mTLS Http Client, and call HTTP(S) server. Also how to do it from localhost and use the tunnel to server ...
The Most Important Thing I've Learned as Junior Developer Sep 29, 2019 Being the annoying one isn't fun for anybody. I explain the problem of asking questions all the time to fellow teammates and offer a solution. ...
Scheduling Hugo Posts with AWS CloudWatch Sep 1, 2019 Hugo builds a static website, so in order to publish something we need to run hugo command and it will output public directory with our website in it. This post explains the process of building the project using AWS CloudWatch at specific times. ...
Postgres - Conditional Order By Aug 25, 2019 In last post, I wrote about ordering by date descending and then time ascending. Building on top of that post, I’ll make a case for conditional order by. This is something that I’ve found in few places in our codebase. The idea is simple, use CASE in ORDER BY statement, where we can check multiple columns. We’ll use two columns this time, first column will be date_created for meta information, and second will be date_of_activation which represents when the user activated some feature. ...
Postgres - Order by Date Descending Time Ascending Aug 18, 2019 This week, I’ve got a request from our project manager to make an update to an existing feature. The update required the feature to have groups by date, which are shown descending, and then in those days, the times should be in ascending order. Everything I’ve written here is executed on a Mac, iTerm 2 command line and using pgcli tool. It’s similar to psql, just with autocomplete and some other neat features. ...
Android - Implementing TextWatcher With Kotlin Aug 11, 2019 I’ve built the part of the app that has a field for numeric input, and goes up to five digits. Something like this: <EditText android:id = "@+id/editText" android:inputType = "number" android:layout_height = "wrap_content" android:layout_width = "wrap_content" android:maxLength = "5" /> The problem was that I could put five zeros there, and the program would work. Being new to Android, I’ve Googled the question and found this StackOverflow answer. From there, it seems I need a TextWatcher implementation and attaching it to editText object. ...
Android - Pass Object to New Activity with Kotlin Aug 3, 2019 I’ve been working on server side programming for almost two years now. I’ve had a bunch of ideas for apps to create, but they require me to learn something on the “front end”. Since I don’t want to worry much about security, keeping the server up and running, and similar problems on the server, I’ve decided to start making Android apps for myself, and maybe publishing them, and even keeping some of them open source on GitHub. ...
Removing Digital Distractions Jun 10, 2019 Something that’s happening to me over and over again is that spend too much time on one medium (social media) and I stick with it for some time that it becomes something that I no longer want to be a part of, something that I don’t enjoy. In August 2016 I deleted my facebook account. I had a (bad) habit tied to facebook - when I woke up, the first thing that I’d do was turn on the computer, open the browser, and start with the letter ‘f’ (for facebook), and let the auto-completion do the work. ...
What I've Learned From 8 Productivity Courses Part 3 May 27, 2019 You’re reading part three, you can read part one here and part two here. 11. Creators vs Consumers This is an idea of splitting people in two categories, the creators and the consumers. From the courses, about 1% of the world are creators. And if you create something, you are in that 1%, so you should feel happy. This can motivate you to be more productive, to produce more content, more things for better world, for creating a better environment for somebody and similar. ...
What I've Learned From 8 Productivity Courses Part 2 May 19, 2019 You’re reading part two, you can read part one here and part three here. 3. Taking breaks You need rest, even for 5 minutes sometimes. To stretch the legs, relax, and do something you like. I remember from one of Robin Sharma’s book the quote, it goes something like this: Having time to pause, refuel and enjoy the life is not a luxury. It’s an absolute necessity. Robin Sharma Getting a good night sleep also helps your memory, since you create new connections in your brain based on your current and past experiences. ...
What I've Learned From 8 Productivity Courses Part 1 May 12, 2019 You’re reading part one, you can read part two here and part three here. At the beginning of the year, I’ve bought a productivity course bundle. I have never bought an online course before, so I thought this could be a useful purchase, and it was. I’m going to share what I’ve learned from those courses, and some blueprints that are in them, something that they have in common. The courses were not only productivity related, but how to become successful too, so that’s going to be covered as well as productivity. ...
Configuring SSH Key-Based Authentication Apr 14, 2019 In previous post I’ve written about how to use SSH client. Now we’ll take a look a bit how SSH Daemon (server) works. From previous post, you should have a running VM with Ubuntu or some other flavour of Linux, with sshd running. You should also know the IP address of that VM. Right now, you can SSH into that VM and it will ask you for a password, just as if you were going to log in into that machine with command line. ...
Tips and Tricks for SSH and SCP Apr 7, 2019 In this post, I’m going to cover SSH Client, and the way I use it. I will try to cover SSH Daemon (server) in one of next few posts. Edit: SSH Daemon (server) is covered in next post. Audience This post is for anybody who has at least some knowledge of Linux and command line. If you’re comfortable with the command line, you can skim through the command line samples, but my guess is that you won’t find this post that much useful. ...
Hosting Serverless Hugo on AWS Mar 31, 2019 This is a work in progress, and I will probably update this post anytime soon, or will create a new one(s), to elaborate the topic(s). Note: This post is made for somebody with experience, but I tried to keep it as simple as possible so somebody without much technical knowledge would understand. That’s why I elaborated some terminology. Probably this is to be updated soon to be understood more clearly to people who are new to this. ...
Which Programming Language You Should Learn First Mar 24, 2019 There are a people saying a lot of different things about which programming language you should learn first. But they don’t give an impression of a language being a tool, but being a must. You should understand that programming languages are tools, and now, as cloud computing is just getting bigger and bigger, you will probably use multiple languages. But they are tools for the job. Some are for user interface, some for user experience and communication with server, some are for design, others for logic, others for manipulating and storing data, etc. ...