Ulzurrun de Asanza i Sàez

Category: Tips

Tips, tricks and useful snippets that may be handy.

Structured JSON logging in AWS Lambda with Kotlin and Log4j2

JVM ecosystem has a steep learning curve: missing a Maven/Gradle dependency might end up being a cryptic runtime exception about a package that is partially referenced in an XML file. I experienced this recently at work, trying to set up Log4j2 to write JSON logs in an AWS Lambda function.

Read more →

How to make Docker build faster reducing build context size

When you build a Docker image you will notice a “transferring context” step in the output (“Sending build context to Docker daemon” in older Docker versions) that can take a lot of time. This step is just Docker copying local files so keeping those to the minimum will make this step faster.

Read more →

How to reduce Docker images size

It’s easy to make Docker images bigger than needed. This has a negative impact in both push and pull time but it may also be hiding additional problems you should address before they become critical.

In this post I will explain you three techniques to help you slim down your Docker images:

Read more →

Validate Jenkinfiles in VSCode

Jenkins pipelines are cool but writing Jenkinsfiles is a frustrating experience, especially if you are not familiar with Groovy. Testing them can be tedious, too. And to add insult to injury, editor support is not quite good.

However, there are ways to make Jenkinsfile development less painful. One quality of life improvement is being able to validate a Jenkinsfile while developing it, directly in VSCode.

To add linter-like support for Jenkinsfiles in VSCode, take a look at Jenkins Pipeline Linter Connector extension (view).

Read more →

Fixing Cocos2d-x glitches with pixel art games

While developing Hop Raider we found a rare glitch in floor’s tiles: sometimes they had an additional semi-transparent border line which was not supposed to be there. We discovered that some sprites were taking a bigger bounding box than they were supposed to, so when a sprite was drawn an additional line taken from adjacent sprites in the spritesheet was also drawn.

If you look carefully (or not so carefully) to the rock base floor in Hop Raider 1.2.1 or older you can see this glitch. It happens in lava tiles too. And this glitch is iOS/Android-independent. This usually happens in rock base floor, lava and sometimes in right-side dirt floors.

As it was somehow random (and actually it didn’t impact in gameplay and didn’t break overall game experience) we didn’t prioritise fixing this glitch but today I have been able to fix it and wanted to share both, the reason of and the solution to the problem.

Read more →

Fixing greyed out songs on iTunes Library

I use iTunes as my main media player and I’m user of iTunes Match since the service was available to Spanish users. It’s a service I really like but recently I’ve experienced an estrange issue: some songs appeared greyed out (even complete albums). I could download them and play them individually but when playing a playlist or album with greyed out songs, iTunes completely skipped them.

Today, thanks to iMore forums, I discovered how to fix this issue.  You have to list all your songs, this can be done following these steps:

  1. Select Music tab on iTunes’ leftmost button bar.
  2. Choose either My Music or Playlists in the middle tab bar.
  3. Open Sort popup by clicking rightmost button in the bar you’ve been interacting with.
  4. Finally, in the dropdown, choose Songs.

You’ll notice that the first column with header has no clear title but a simple check icon. You can customise all the columns but this one, which is always displayed regardless your settings. Checked songs will be playable and unchecked ones won’t. I don’t know why some of my songs where checked and others unchecked neither what really means that a song is checked or not but checking all my songs fixed the issue so, finally, to fix the greyed out issue:

  1. Select all your songs.
  2. Control-click any of them.
  3. On the displayed menu click on Check selection.