How to get information about a gem (via CLI or at runtime from Ruby)

Posted About 2 years ago by Arne Hartherz.

When you need information about a gem (like version(s) or install path(s)), you can use the gem binary...

JavaScript: Working with Query Parameters

Posted About 2 years ago by Julian.

tl;dr: Use the URLSearchParams API to make your live easier if you want to get or manipulate query parameters...

Version 5 of the Ruby Redis gem removes Redis.current

Posted About 2 years ago by Arne Hartherz.

Redis.current will be removed without replacement in redis-rb 5.0. Version 4.6.0 adds deprecation warnings for Redis.current and Redis.current=: `Redis.current...

How to add esbuild to the rails asset pipeline

Posted About 2 years ago.

This are the steps I needed to do to add esbuild to an application that used the vanilla rails asset...

esbuild: Make your Rails application show build errors

Posted Over 2 years ago by Arne Hartherz.

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

Carrierwave: How to attach files in tests

Posted Over 2 years ago by Emanuel.

Attaching files to a field that is handled by Carrierwave uploaders (or maybe any other attachment solution for Rails) in...

Using ngrok for exposing your development server to the internet

Posted Over 2 years ago by Tobias Kraze.

Sometimes you need to access a dev server running on localhost from another machine that is not part of the...

RSpec: Inferring spec type from file location

Posted Over 2 years ago by Emanuel.

RSpec Rails can automatically mix in different behaviors to your tests based on their type tag, for example enabling you...

Caching in Rails < 6.1 may down parts of your application when using public cache control

Posted Over 2 years ago by Dominic Beger.

Proxy caching is a good feature to serve your publicly visible application content faster and reduce load on your servers...

New gem: Rack::SteadyETag

Posted Over 2 years ago by Henning Koch.
github.com

Rack::SteadyETag is a Rack middleware that generates the same default ETag for responses that only differ in CSRF tokens...

Elasticsearch: recover from readonly mode

Posted Over 2 years ago by Daniel Straßner.

Elasticsearch defaults to go into readonly mode when you run low on disk space (< 95%). You might then see an...

Ad blockers: How to debug blocked elements

Posted Over 2 years ago by Daniel Straßner.

Some users might use Adblock Plus or similar browser plugins to reduce the number of ads displayed. If you run...

Using feature flags to stabilize flaky E2E tests

Posted Over 2 years ago by Henning Koch.

A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs...

Setup Sidekiq and Redis

Posted Over 2 years ago by Klaus Weidinger.

If you want Sidekiq to be able to talk to Redis on staging and production servers, you need to add...

RSpec: how to prevent the Rails debug page if you want to actually test for 404s

Posted Over 2 years ago by Klaus Weidinger.

Within development and test environments, Rails is usually configured to show a detailed debug page instead of 404s. However, there...

RSpec: automatic creation of VCR cassettes

Posted Over 2 years ago by Klaus Weidinger.

This RailsCast demonstrated a very convenient method to activate VCR for a spec by simply tagging it with :vcr.

Working on the Linux command line: How to use bookmarks for directories

Posted Over 2 years ago.

Bookmarks for directories will be most helpful if you are forced to work in deeply nested projects. Then it's...

Working on the Linux command line: How to efficiently navigate up

Posted Over 2 years ago.

With cd .. you can navigate one directory up from the one you are at now. If you use that a...

Unpoly 2: Don't try to download files through AJAX requests

Posted Over 2 years ago by Jakob Scholz.

Rails has the handy controller method send_file which lets us download files easily. We can decide whether the file...

You should probably load your JavaScript with <script defer>

Posted Over 2 years ago by Henning Koch.

It is generally discouraged to load your JavaScript by a tag in the : The reason is that a tag will pause the DOM parser until the script has loaded and executed. This will delay the browser's first contentful paint. A much better default is to load your scripts with a tag: A deferred script has many...

Bookmarklet to facilitate generating new git branches for PivotalTracker Stories

Posted Over 2 years ago by Klaus Weidinger.

This bookmarklet grabs a PivotalTracker story title, transforms it into a valid git branch name and automatically prepends your initials...

Headless Chrome: Changing the Accept-Language header is not possible

Posted Almost 3 years ago by Emanuel.

It seems like changing the HTTP_ACCEPT_LANGUAGE is not possible for a headless chrome. On Ubuntu the headless Chrome...

Modern HTTP Status codes for redirecting

Posted Almost 3 years ago.
en.wikipedia.org

Formerly 301 (Moved Permanently) and 302 (Found) were used for redirecting. Browsers did implement them in different ways, so since...

How to avoid raising RestClient exceptions for 4xx or 5xx results

Posted Almost 3 years ago by Arne Hartherz.

When using RestClient to make an HTTP request, it will raise an exception when receiving a non-successful response.