thegnar.com

...instead of using a more costing feature spec. This is especially useful because they become quite convenient when used with Capybara::Node::Finders and Capybara::RSpecMatchers. This allows to wirte...

...view might be too isolated, since view-specs will mock a lot of rails behavior and render the view independent from the controller-logic. Therefore it will be more applicable...

Download buttons can be difficult to test, especially with Selenium. Depending on browser, user settings and response headers, one of...

Why do we migrate? Due to a change in licensing, we cannot provide Elasticsearch versions >= 8.0. Version 7.17.x will...

You can use the config.x configuration in combination with config_for to configure global settings for your Rails 4.2+ application...

...changes it for the current repository. Since it's hard to remember which project behaves how, you should find a suitable global setting. Regardless which option you use you can...

...current branch. Caveat with current For most of us, current is the safest push behavior. However, it has a small side effect: When a branch with your local name does...

When a user shares your content, a snippet with title, image, link and description appears in her timeline. By default...

digitalocean.com

I recommend install Node.js using nvm. This way you can have multiple Node versions in your ~/.nvm. You also won...

You cannot use Array#join on an array of strings where some strings are html_safe and others are not...

If you're responsible for gatekeeping in a projects, here is a guide, what to do. In order to reduce...

geekytidbits.com

To retrieve only unique combinations of the selected attributes: You can omit rows, where all selected columns are equal with...

...won't need this for single lines of text. In this case it is better to just use the text-overflow property: Use CSS "text-overflow" to truncate long texts...

...starts wrapping within its container. This is most probably because there is no defined behavior in case multiple text contents are rendered next to each other (horizontally) and the clamping...

makandra dev
github.com

...rendering quality is now fine in recent versions of wkhtmltopdf (0.12+). You will never beat LaTeX if you need perfect font rendering. If you are observing strange behavior when including...

...might experience that your application "locks up" whenever you request a .pdf route. This behavior is caused by a deadlock: The Rails process is trying to render the page to...

...the old versions you wish to remove. Keep at least one recent, working kernel besides the one you are currently running. Address Metapackage Conflict (GA vs. HWE)

def self.acquire(name) already_acquired = definitely_acquired?(name) if already_acquired yield else begin create(:name => name) unless find_by_name(name) rescue ActiveRecord::StatementInvalid # concurrent create is okay...

begin result = nil transaction do find_by_name(name, :lock => true) # this is the call that will block acquired_lock(name) result = yield end result ensure maybe_released_lock...

...blocks or confusingly sometimes also procs Those with "method semantics", called lambdas lambdas They behave like Ruby method definitions: They are strict about their arguments. return means "exit the lambda...

...the lambda literal -> (since Ruby 1.9.1) test = ->(arg) do puts arg end blocks They behave like do-blocks or simply "segments of code": They try to be smart about their...

It might sometimes be useful to check whether your Rails application accesses the file system unnecessarily, for example if your...

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

Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background

...used when you are working on a branch and make a new commits which belongs to a previous commit. If the previous commit is the last commit, you can also...

Even though the process in #1 could be used for this it can become quite tedious if you have a large commit and might have already done this and...

When loading a database dump created with pg_dump into your database, you might run into an error like

In a project team for a bigger project people have several roles: Developer: at makandra Project lead: at makandra

When an event listener on a DOM element throws an error, that error will be silenced and not interrupt your...

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

Developing or debugging SAML functionality can be a hassle, especially when you need to go back and forth with someone...