makandra dev

Cross-Site Request Forgery (CSRF) is an attack pattern for websites. A CSRF attack is usually relevant in a...

A JavaScript error in an E2E test with Selenium will not cause your test to fail. This may cause you...

developer.mozilla.org

...HTML's accepts a single file. You can allow multiple files via . But sometimes, selecting multiple files is not enough...

Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...

makandra dev

If you need to run a program on a remote machine (e.g. to your office PC) with a graphical UI...

Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a...

At makandra, we've built a few gems over the years. Some of these are quite popular: spreewald (> 1M downloads...

As a web developer, you know Google Analytics (GA). Probably you've dropped the GA snippet into more than one...

Why secure-only cookies used to be necessary Cookies have an optional secure flag. It tells the browser to not...

stackoverflow.com

Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...

The method cookies is defined in the ActionController and should never be overwritten. Bad example class StaticPagesController < ApplicationController

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

makandra dev

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

github.com

Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...

When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...

Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...

github.com

This might be a known issue with Rubygems 2.5.1. This will help: gem update --system

Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due...

If you have a single node elasticsearch instance and indices with replicas enabled your cluster state will be yellow. If...

api.rubyonrails.org

Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...

Running rails server will start a local server that you can access via http://localhost:3000. When you are working...

stackoverflow.com

Your default postgres user is named like your linux user. That default user has limited access privileges, which can cause...

This should not be necessary in any case and is only for special cases, for e.g. if the assets...

With passenger-status --show=requests you can get a huge JSON showing current information about the running passenger processes.