Rails: Different flavors of concatting HTML safe strings in helpers

Posted About 16 hours ago by Emanuel.

This card describes different flavors for concatting HTML safe strings in a helper method in Rails. You might want to...

How to handle when an HTML <video> element cannot autoplay

Posted 8 days ago by Arne Hartherz.

...HTML elements can automatically start playing when the autoplay attribute is set on them. Except for when they can not...

Using rack-mini-profiler (with Unpoly)

Posted 8 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 9 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...

Caution: rem in @media query definitions ignore your font-size

Posted 10 days ago by Dominik Schöler.

Note Using rem only ever makes sense when the root font size is dynamic, i.e. you leave control to the...

Debug SAML in development using a local keycloak server

Posted 15 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...

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

Geordi 10.0.0 released

Posted About 1 month ago by Dennis.

10.0.0 2024-03-07 Compatible changes console command: You can now globally disable the IRB multiline feature by setting irb...

Grid by Example: a website about CSS Grid

Posted About 2 months ago by Dominik Schöler.
gridbyexample.com

Rachel Andrew has built a website about CSS Grid. Video tutorials More than 30 layout examples for feature demonstration

Chaining Capybara matchers in RSpec

Posted About 2 months ago by Henning Koch.

You can chain multiple Capybara matchers on the page or any element: expect(page) .to have_content('Example Course')

UX details for web developers

Posted About 2 months ago by Dominik Schöler.
interfaces.rauno.me

A list of implementation details that make for a better / expected user experience. Have these in mind when implementing a...

Accessibility: Making non-standard elements interactive

Posted About 2 months ago by Michael Leimstädtner.
developer.mozilla.org

A common cause of non-accessible web pages are elements that were made interactive via JavaScript but cannot be focused...

Updated: In Chrome 121+ the now supported spec-compliant scrollbar properties override the non-standard `-webkit-scrollbar-*` styles

Posted 2 months ago by Fabian Schwarz.
makandracards.com

It is still possible to style the -webkit-scrollbar-* pseudo elements in Chrome 121+. However the now supported spec-compliant...

How to display an unsaved changes alert

Posted 3 months ago by Michael Leimstädtner.

All browsers implement an event named beforeunload. It is fired when the active window is closed and can be used...

In Chrome 121+ the now supported spec-compliant scrollbar properties override the non-standard `-webkit-scrollbar-*` styles

Posted 3 months ago by Arne Hartherz.

Up until Chrome 120, scrollbars could only be styled using the various -webkit-scrollbar-* pseudo elements, e.g. to make the...

Heads up: You should always use "current_window.resize_to" to resize the browser window in tests

Posted 3 months ago by Michael Leimstädtner.

I recently noticed a new kind of flaky tests on the slow free tier GitHub Action runners: Integration tests were...

Use <input type="number"> for numeric form fields

Posted 3 months ago by Arne Hartherz.

Any form fields where users enter numbers should be an . Numeric inputs have several benefits over : On mobile or tablet...

Firefox ESR Release Calendar

Posted 3 months ago by Henning Koch.
whattrainisitnow.com

The linked table shows the support lifecycle for Firefox Extended Support Releases (ESR) which we sometimes need to support for...

How to configure Selenium WebDriver to not automatically close alerts or other browser dialogs

Posted 3 months ago by Arne Hartherz.

tl;dr We recommend configuring Selenium's unhandled prompt behavior to "ignore". When running tests in a real browser, we...

Best practices: Writing a Rails script (and how to test it)

Posted 3 months ago by Dominik Schöler.

A Rails script lives in lib/scripts and is run with bin/rails runner lib/scripts/.... They are a simple tool to perform...

Bash: How to count and sort requests by IP from the access logs

Posted 3 months ago by Emanuel.

87.140.79.42 - - [23/Jan/2024:09:00:46 +0100] "GET /monitoring/pings/ HTTP/1.1" 200 814 "-" "Ruby" 87.140.79.42 - - [23/Jan/2024:09:00:46 +0100] "GET...

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

Rails: Testing the number of database queries

Posted 3 months ago by Dominik Schöler.
github.com

There are a few tools to combat the dreaded n+1 queries. The bullet gem notifies you of missing eager...

Element.animate() to animate single elements with given keyframes

Posted 3 months ago by Nico Winkler.
developer.mozilla.org

Today I learned that you can animate HTML elements using the Web Animation API's method .animate(keyframes, options) (which...