...issues, where you want to have a specific order of after_commit actions. Documented behavior Taken from the API documentation Registers a block to be called after all the current...
...as the video is free for end users." (MDN) H.265 / HEVC see H.264 (successor, better compression as H.264) VP8 royalty free VP9 royalty free (sucessor, better bit rate as VP8...
royalty free (planned successor of VP9 with better compression rates) Further reading: MDN: Web video codec guide Audio Codec Format Matrix A broader comparison of many audio codecs can...
...However, users with limited bandwidth (i.e. on mobile) need to mine their data budget better. One popular strategy to improve the website performance is to not load images until they...
...via jQuery, as it does not support capturing events. JS-only: not working The "best" strategy would be to hide the src attribute of image tags from the browser with...
When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...
...first get a general overview of the most popular solutions. To chose a single "best" of those, ask yourself questions such as: Is the library still maintained? When was the...
...level of our own standards. Does it have a ton of dependencies? Fewer is better, in this case. Sites like the Ruby Toolbox (only for gems) or npm compare may...
...request and model using implicit and convoluted protocols. We prefer a different approach. We believe that among all the classes in a Rails project, controllers are some of the hardest...
...to test and understand and should receive special care. It is our belief that: Controllers should be short and tidy Controllers should receive the same amount of programming discipline as...
CSS variables are very different from preprocessor variables. While preprocessors use variables to compile a static piece of CSS, CSS...
...Haml maintainer, this negatively impacted rendering performance. So in Haml 6, they kept this behavior only for a few attributes, which they called "boolean". All other attributes will just render...
...their value as it is given. Behavior of "boolean attributes" remains unchanged No Haml value => no HTML value Boolean Haml value => attribute is rendered depending on that value
It happens from time to time that a job in a GitLab pipeline fails. Sometimes, however, the error message is...
Foo Bar When a non-expanded link is clicked, now only that link becomes .up-active: Foo Bar Preserving fragments Two changes were made to preserving elements using the...
There are two ways a logout in SAML can happen: Service Provider (SP) initiated and Identity Provider (IDP) initiated logout...
...ms long. Once a frame renders longer than 16ms, the page will begin to feel staggering and slow. Google Chrome DevTools The Chrome DevTools enable you to precisely investigate and...
...complex. Deeply nested rules and slow selectors are the main cost factors. Using a BEM pattern for CSS should produce relatively fast CSS. Performance issue 4: Slow repaints
The Truemail gem (not to be confused with truemail.io) allows validating email addresses, e.g. when users enter them into a...
Ruby has the class Rational which allows you to store exact fractions. Any calculation on these variables will now use...
The standard way to abort async code is that your function takes a AbortSignal { signal } property. The caller can use...
...argument. Also, the code after the yield in example is not executed! Probably, this behavior was designed to enable programmers writing their own iterators (like while or loop) as methods...
ignore_rules << (pattern || block) end def mute(&block) @muted = true if block begin block.call ensure unmute end end end def unmute @muted = false end def self.current @current ||= new...
If you want to perform a failover on another haproxy backend server this is the way you should do it...
TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.
...the number and last point in time when autovacuum and autoanalyze happened for tables belonging to the currently connected database. SELECT relation::regclass, * FROM pg_locks WHERE not granted;
Event delegation is a pattern where a container element has a single event listener that handles events for all descendants...
...for the event to be processed before continuing - the event could prevent the default behavior. Luckily there is a concept called passive event listeners which is supported by all modern...
...see a performance gain when declaring scroll events as passive. To improve the scrolling behavior you should still try to keep the execution time of your handler to a minimum...
Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...
...notification service: Use @Input() id: number with component input binding; Update notification.service.ts: Define notification$: BehaviorSubject: Store the last fetched notification; Update notification$ when a new notification is fetched; Using Efficient...
...keywords in your prompts. LLMs excel at pattern recognition, and specific terminology reduces ambiguity. Beyond that giving examples for high level APIs of your imagened class design or using an...