Using rack-mini-profiler (with Unpoly)

Posted 3 days ago by Niklas Hä..

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

SAML Single Logout (SLO)

Posted 3 days ago by Martin Schaflitzl.

There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout...

Debug SAML in development using a local keycloak server

Posted 10 days ago by Martin Schaflitzl.

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

Ruby: How to connect to a host with expired SSL certificate

Posted 11 days ago by Arne Hartherz.

If you need to make an HTTPS connection to a host which uses an expired certificate, do not disable certificate...

Rails: Testing file downloads with request specs

Posted About 1 month ago by Julian.

tl;dr Prefer request specs over end-to-end tests (Capybara) to joyfully test file downloads! Why? Testing file downloads

List of handy Ruby scripts to transcode different file types (often by using GPT)

Posted About 1 month ago by Michael Leimstädtner.

It's 2024 and we have tools like ffmpeg, imagemagick and GPT readily available. With them, it's easy to...

Virtual scrolling: A solution for scrolling wide content on desktops

Posted About 2 months ago by Tobias Kraze.

I recently built a screen with a very high and wide table in the center. This posed some challenges:

Bash: How to grep logs for a pattern and expand it to the full request

Posted 3 months ago by Emanuel.

I, [2024-01-21T06:22:17.484221 #2698200] INFO -- : [4cdad7a4-8617-4bc9-84e9-c40364eea2e4] test

Unpoly 3.7.1, 3.7.2 and 3.7.3 released

Posted 3 months ago by Henning Koch.
unpoly.com

Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard. 3.7.1 This change fixes...

Browser debugging tricks

Posted 3 months ago by Dominik Schöler.
alan.norbauer.com

A list of clever debugging tricks. TOC: Advanced Conditional Breakpoints monitor() class Calls Call and Debug a Function Pause Execution...

open-next-failure: An alias to speed up test debugging

Posted 4 months ago by Michael Leimstädtner.

Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that is...

Livereload + esbuild

Posted 4 months ago by Tobias Kraze.

Getting CSS (and JS) live reloading to work in a esbuild / Rails project is a bit of a hassle, but...

How to (and how not to) design REST APIs · stickfigure/blog Wiki

Posted 5 months ago by Henning Koch.
github.com

In my career, I have consumed hundreds of REST APIs and produced dozens. Since I often see the same mistakes...

A reasonable default CSP for Rails projects

Posted 5 months ago by Tobias Kraze.

Every modern Rails app should have a Content Security Policy enabled. Very compatible default The following "default" is a minimal...

How to: Upgrade CarrierWave to 3.x

Posted 5 months ago by Dominic Beger.

While upgrading CarrierWave from version 0.11.x to 3.x, we encountered some very nasty fails. Below are the basic...

Zeitwerk: How to collapse folders in Rails

Posted 5 months ago by Niklas Hä..

All direct child directories of app are automatically added to the eager- and autoload paths. They do NOT create a...

Heads Up: Selenium 4 uses a binary to determine the chromedriver

Posted 6 months ago by Florian Leinsinger.
selenium.dev

I recently stumbled over a problem that my feature tests broke in CI because of a mismatching chromedriver version.

RSpec: Leverage the power of Capybara Finders and Matchers for view specs

Posted 6 months ago by Felix Eschey.
thegnar.com

View specs are a powerful tool to test several rendering paths by their cases instead of using a more costing...

Using Ruby's Method objects for inspecting methods

Posted 6 months ago by Felix Eschey.
ruby-doc.org

Do you remember finding where a method is defined? I recently learned from a senior colleague that Method objects are...

Git restore vs. reset for reverting previous revisions

Posted 7 months ago by Felix Eschey.

The git doc states on the difference of these two commands: git-restore[1] is about restoring files in the...

redirect_to and redirect

Posted 7 months ago by Niklas Hä..

There are multiple ways to redirect URLs to a different URL in Rails, and they differ in small but important...

Do not pass params directly into url_for or URL helpers

Posted 7 months ago by Arne Hartherz.

Rails' url_for is useful for generating routes from a Hash, but can lead to an open redirect vulnerability.

Do not use "permit!" for params

Posted 7 months ago by Arne Hartherz.

Rails' Strong Parameters enable you to allow only specific values from request params to e.g. avoid mass assignment.

Node: How to run a globally installed package with npx

Posted 8 months ago by Emanuel.

You can tell npm to install a package globally with npm -g install @puppeteer/browsers. However, it seems that its not...