My first Hanami app

Posted on 2023-02-14 by Karol Bąk Comments
ruby
hanami

In my opinion, Hanami is a breath of fresh air in the ruby world. Let's take a look at why, and how it's different from Rails. Read more

Signed URLs with Ruby

Posted on 2023-01-16 by Karol Bąk Comments
ruby
rails
security

Signed URLs can be a very useful solution in many cases when you need to provide limited access to some resources or actions. As the name suggests, signed URLs contain signatures that allow us to validate if they were generated by a trusted source. I'll focus on when and how to use them in Ruby, with Rails, or by providing a custom implementation. Read more

Securing Rails applications with Content Security Policy

Posted on 2022-10-27 by Karol Bąk Comments
ruby
rails
security

Nowadays web application security is a crucial and unfortunately sometimes a bit neglected matter. Today, I'll focus on Content Security Policy - a handy mechanism that can protect our app from XSS attacks. Read more

Dependency Injection in Ruby

Posted on 2022-02-07 by Karol Bąk Comments
ruby
di

Dependency Injection is not a common pattern in ruby applications. Although even in such flexible language as ruby there is a place for DI. Read more

Google-like letter avatars using ERB-generated SVGs

Posted on 2021-06-30 by Karol Bąk Comments
ruby
rails
svg

Creating user avatars is a pretty simple thing. It can be done even without any libraries like imagemagick. With just ERB we are able to quickly generate SVG avatars that will work in all browsers. Read more

Useful Active Support features you may not have heard of

Posted on 2021-05-10 by Karol Bąk Comments
ruby
rails
activesupport

Active Support is a really powerful library that is a part of Rails framework. Today we will focus on utilities it includes, which can be useful in your next Rails project or any other ruby app. Read more

Automatic image moderation using Amazon Rekognition

Posted on 2020-02-10 by Karol Bąk Comments
ruby
aws
rails

Today we will focus on Amazon Rekognition which can help us with automatic moderation of uploaded images. By adding custom validation we can prevent uploading images which contain nudity, violence or other inappropriate content. Read more

Handling Ruby 2.7 deprecations warnings

Posted on 2020-02-03 by Karol Bąk Comments
ruby
rails

In Ruby 3.0, positional arguments and keyword arguments will be separated. For now ruby 2.7 brings deprecations warnings that notifies us that our code should be updated. How should we handle them? Read more

Deploying Rails application with Dokku

Posted on 2020-02-01 by Karol Bąk Comments
ruby
rails
dokku
devops

Dokku is a simple PaaS that allows you to easily deploy your application. After short setup it can be a great substitute for heroku. In this article I'll show how to deploy Rails app with postgres, sidekiq, redis and Let's Encrypt SSL certificate. Read more