Articles

  • Responsibility On Rails

    Being a web-developer is one of the coolest jobs in the world. It brings freedom and growth opportunities like no other job in the world. It’s easy to just enjoy the fruits of this craft. But remember with great benefits comes great responsibility.
  • Order attachments in Rails ActiveStorage has_many_attached

    How to change order of Active Storage has_many_attached attachments
  • Custom domain / subdomain for website hosted on AWS S3

    You can use AWS S3 bucket to host static websites. In this article I'll show you how you can set this up with custom subdomains / domains using AWS CLI
  • Visualized desktop workspaces flow

    Desktop Workspaces are designed to hold multiple applications in different contexts. This article will try to show you how you can organize and access these applications in relation to their responsibilities to boost your productivity.
  • 2019 set up Ubuntu 18.04 for Ruby on Rails developer (Cheatsheet)

    Quick cheatsheet how to install various technologies for Ruby on Rails application under fresh Ubuntu 18.04 machine (2019 revised article)
  • Duck Typing in Rails

    In programming there is a powerful concept called "duck typing" in which you copmose objects without the need to worry what kind of type they are. You just call public interfaces methods and you expect them to "quack" like a duck. It walks like a duck and it quacks like a duck, then it must be a duck.
  • Ruby Sinatra on AWS Lambda

    AWS Lambda now Supports Ruby natively. That means we can build serverless applications with the language we all love. Not only that doh. You can run small Sinatra microservices with AWS serverless approach and in this article we will have a look how/why
  • Is Rails still relevant in 2018 ?

    Is Ruby on Rails still relevant technology to learn in 2018 ?
  • How to configure RSpec in Ruby on Rails

    Step by step article for Junior Rails developers on how to configure RSpec in Ruby on Rails, Factory Bot and Database Cleaner
  • Back to the primitive. Testing with simplicity

    Our tests (same as our code) needs to be maintained and clean. Therefore we often try to reuse parts of application in the tests. This may lead to several problems that we may get away with if we just tested the most primitive objects we can like "Strings, Integers" etc.
  • Rails CSRF protection for SPA

    How to secure Rails API for SPA with CSRF protection. Is it needed for token headers (e.g.: Bearer token, JWT) ? Or just for session cookies?
  • Ruby on Rails - Bounded contexts via interface objects

    In this Article I'll show you how to organize business classes in Ruby on Rails so your application can benefit from Bounded Contexts while still keep Rails conventions and best practices. Solution is also friendly for junior developers.
  • Ruby class methods syntax

    In Ruby there are several ways how to define a class method. In this article I'll go trough 4 major ways and explain what class methods really are.
  • Explicit contracts for Rails - HTTP API usecase

    HTTP Explicit contracts are straight forward way how to write fixtures like tests for consuming 3rd party APIs. They can be easier to maintain compare to mocks
  • Memoization, Caching and SQL query optimization in Ruby on Rails

    There are different ways to increase your performance in Ruby on Rails application, there is no silver bullet. In this article I'll show some of the techniques.
  • Write more explicit code layers !

    When building a web-application you may loose track of what data is controller receiving from interface. We will have a look on how to design the code so that we will communicate our intentions better for our colegues
  • Lesson learned after trying functional programming (as a Ruby developer)

    Ruby is all about Objects. But in this article we will have a look on how your Ruby and Ruby on Rails application team can benefit from more more functional flavor of programming.
  • Ruby #call method

    Ruby method #call is common interface protocol for calling Lambdas, Method objects, Procs,... In this article I'll try to present why it's important to name the run method #call in your custom class objects
  • CSRF protection on single page app API

    Single Page application is awesome paradigm but because they communicate with APIs there is lot of confusion around what security measures are needed and what are unnecessary. In this article I'll try to explain when is CSRF protection needed.
  • Deep dive into Cloud coding

    Cloud Coding is a method of developing software on a remote VM. In this article I'll give you some insight on benefits and the flow.
  • Rails Asset Pipeline compilation and Docker

    Discussion on Rails Asset Pipeline compile in Docker image so that CDN can pick up assets.
  • Policy Objects in Ruby on Rails

    Authorization (unlike Authentication) is really complex topic that may go wrong when using generic solutions. In this article I will show you how to write Policy Objects specific to your business logic.
  • Github credentials in bundler

    How to build Gemfile with private gems with bundler inside docker image
  • Expressive tests with RSpec - part 1: Describe your tests properly

    Lot of time developers just write the logical evaluation for the test but don't quite express their intention. RSpec is really expressive testing library. This article is first article in my article series on \"Expressive testing with RSpec\" and will help you to better use describe and context blocks and be able to DRY the tests.
  • Rails ActiveRecord Relation (Arel), composition and Query Objects

    Ruby on Rails ActiveRecord::Relation (or Arel) is really handy tool to create complex SQL calls. In this article I'll show you several tricks I've came across over the years and show you how to combine them to Query Objects and Query Interfaces
  • POST != Create and PUT != Update

    Ruby on Rails developers tend to think that HTTP method POST represents Create and PUT means Update. Well, not really. The CRUD mapping of modern web-frameworks just limits the scope of this HTTP methods for sake of simplicity in code design. Read more in this article what they really stand for.
  • PATCH vs PUT and the PATCH JSON syntax war

    There is still lot of confusion on PUT vs PATCH HTTP methods and the JSON syntax. In this article I will try to explain the difference and present pragmatic solution to PATCH syntax problems.
  • Setup Ubuntu 16.04 for Ruby on Rails app (Cheatsheet)

    Quick cheatsheet how to install various technologies for Ruby on Rails application under fresh Ubuntu 16.04 machine
  • Setup AWS Elastic Beanstalk

    In this article I will show you how to Set up AWS Elastic Beanstalk Docker environment, RDS, ElasticCache and Security Groups for demo Ruby on Rails application.
  • How to configure Route 53 to Cloudflare

    How to properly set up Cloudflare with Route 53
  • Various CORS issues related (not only to) Ruby on Rails

    CORS may be bit tricky (not only) for Ruby on Rails application. In this article we will have a look on some problems and solutions I've dealt with.
  • Simple Authentication for one user in Rails

    In this article we will bulid simple session based authentication for one user for Rails from scratch.
  • Pure RSpec JSON API testing

    In Ruby on Rails there are many tools how to test your JSON API, but you don't necessary need to install any gems. RSpec provide really decent tool set for many scenarios including APIs.
  • AWS ElasticBeanstalk deployment hooks

    How to run post and pre deployment scripts on AWS Elastic Beanstalk running (not only) Docker environment
  • Ruby Enumerable, Enumerator, Lazy and domain specific collection objects

    Ruby has couple of nifty tricks up its sleeves to deal with collection objects so that they map your domain. In this article we will look on Enumerator, Lazy Enumerator and Enumerable and how to implement API collection objects in Plain Ruby so that they can be used in similar way as you would use Rails scopes
  • RSpec be_within matcher

    RSpec 3 be_within matcher for comparing values in delta range
  • Rendering Paperclip url via Elasticsearch without making calls to ActiveRecord DB

    Rendering Paperclip attachments / urls vith Elasticsearch without ActiveRecord calls.
  • Common AWS Elastic Beanstalk Docker issues and solutions.

    Several debugging tricks for AWS Elastic Beanstalk runing Docker
  • Some debugging tips for Ruby on Rails

    Several debugging tricks for Ruby and Ruby or Rails developers
  • Spring Cleaning for WebDevelopers

    After while our machine, Github, server, ... gets piled with old unneeded stuff, here are sme tricks & commands I use for Spring Cleaning in my machine.
  • Different ways how to do contextual Rails validations

    Ruby on Rails has a decent way how to ensure that invalid params won't end up in DB. Problem with Rails Validators is that they are bound to a class rather than Instance object. In this article we will have a look on few workarounds to do context validations.
  • Rails redirects to wrong host (NginX HTTP_X_FORWARDED_HOST)

    Problem I had where NginX was passing wrong HTTP_X_FORWARDED_HOST to Rails and me spend several hours debugging.
  • Ergonomics and faster typing practices for Web Developers

    Ten Finger Typing Technique, Dvorak layout, Split Keyboards and Vim. All this are Techniques and Life Hacks that can improve your productivity and development experience.
  • Setting up simple Wordpress deployment with CodeShip to AWS EC2

    This article will show you a simple way how to set up deployment of a WordPress website via CodeShip
  • Chromebook for Web Developers

    You don't need expensive laptop to be a web-developer or sys-admin guy, all you need is an attitude to get things done. In this article I'll give you my experience on developing commercial web-application backend via chromebook
  • Build Docker images on your machine or in the cloud ?

    Docker images can be build either on local computer or via hosted build servers. Although we all are fans of cloud automation, should we really let hosted solutions build the images for us? Isn't that against Docker philosophy?
  • Scissors Rule in coding

    In coding / software-developing world a rule called Scissors Rule exist several years. Funny enough I couldn't google single article about it :) . In this article I'm summarizing it's base principles
  • cron rbenv bundle exec rake task

    Ruby provide so many easy ways how to create a scheduled job (Whenever gem, Daemons gem, ...) but what if you want to configure something really simple with plain cron along rbenv?
  • `config.force_ssl` is different than controller `force_ssl`

    Rails provide option force_ssl as a global seting and as a controller method. They act the same way in terms of redirect to https but have a huge security affect on cookie security.
  • Ruby Ancestors, Descendants and other annoying relatives

    In Ruby is easy to pull "ancestor" classes of a class. However once developer want to work with "descendants" he may find it's not that easy. This article is providing a way how to look at Ruby ancestor tree
  • JSON array in html element data attribute

    How to pass JSON to HTML element data attribute
  • RSpec matchers in db:seed file

    There is overall confidence that seed files (rake db:seed) don't need any additional testing. But in this article I will show you easy way how to add simple layer of tests during the seed process.
  • Translating locales for Rails model errors

    Proper way how to translate Rails validation messages
  • Mail interceptor for different Rails environments

    Rails mail interceptor to prevent sending emails from being sent for different environments using custom environment configuration options.
  • RSpec performance improvements with before all

    Improve your test-suite performance by properly using before(:all), after(:all) RSpec hooks so that you trigger less database queries.
  • Render image with Rails controller

    How to stream images with Ruby on Rails controller so that you can fake that images are located on your server.
  • Jenkins CI for Rails 4, RSpec, Cucumber, Selenium

    Jenkins CI to test your Rails app with RSpec Cucumber (Spinach), Selenium and also doing tested deployments.
  • Temporary enable dalli store in RSpec specs

    Ideally when you're running tests you don't want to cache anything, but there are some cases that you need to make sure stuff is working with caching enabled. This article will show you how to temporary enable Dalli cache for some of your specs
  • Installing rbenv on Ubuntu machine

    Set up rbenv on Ubuntu
  • Installing Nginx 1.4.4 from source on Ubuntu 12.04 (Precise)

    Step by step manual to install NginX on Ubuntu 12.04 (Precise) from source with SNI support without headache.
  • Shoulda matchers depricated. Now what ?

    Thoughtbots team behind gem shoulda_matches have decide to depricate several matchers in version 2.0. Lot of people still find them useful. Read more to see alternatives.