It happens from time to time that a job in a GitLab pipeline fails. Sometimes, however, the error message is...

You may remember to use the || operator with caution to set defaults. We'll see that && and other conditionals come...

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

TL;DR When using Cache-Control on a Rails application, make sure the Vary: Accept header is set.

...Rails code is doing the delivery you can do your usual authentication and authorization beforehand. There are few exceptions where you want to store confidential files in the public folder...

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

makandra dev

Static error pages To add a few basic styles to the default error pages in Rails, just edit the default...

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

makandra dev
github.com

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

makandra Operations

...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;

When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...

...The bash functions above are only an iteration from my previous bash alias. It became quite unreadable over time and and copies the raw XML to the clipboard (not files...

...confident about upgrading Rails, have a look at Rails LTS. How many update steps? Besides the Rails upgrade itself, you might also want to upgrade your other gems and upgrade...

...many cases updating to the highest subversion of the specific rails version is the best choice (e.g. when updating to rails 5 you would update to 5.2.8.12), since the most...

When Paperclip attachments should only be downloadable for selected users, there are three ways to go. The same applies to...

makandra dev

...I am really pleased with it -- but only on a desktop computer. Have you benchmarked the framework also on smartphones and tablets? Unfortunately I must say, that it does not...

...as a jQuery collection: let $element = $(element) An API object to call additional JavaScript behavior added by a library: var player = flowplayer($element) player.play() Framework activation layers (like Angular directives...

In a JavaScript console, type this: > 9112347935156469760 9112347935156470000 Ooops. And that's not a float! This occurs because JavaScript uses...

When working with feature branches, stale branches pile up over time. It's best to remove them right after merge, locally and on the remote, but it is a little...

if [[ "$merged_branch_name" =~ ^(master|main|production|Fast-forward)$ ]]; then exit 0 fi # Begin output echo " " echo "> You have just merged the branch \"$merged_branch_name\" into \"$branch_name...

makandra Curriculum

Basic validations Read the Rails Guide on ActiveRecord Validations. You should have an overview which kinds of validations are built...

...instead of downloading and bundling font files yourself. (See below for a list of benefits.) Usage Go to fontsource.org and search for the font you want to add (or a...

...s Fontsource details page for available settings. Why? Using an NPM package has some benefits over placing fonts into your repo: All font weights and glyphs are included.

...or use a more mature solution like Webpack. Modules shared between entry points always become chunks When two entry points import the same module, that module automatically a separate file...

...a way to set a minimum file size for chunking, or to control chunking behavior per import. However there is currently no configuration at all. Modules imported by multiple entry...

makandra dev

...with power comes responsibility. Code comments can go wrong in many ways: they may become outdated, silently move away from the code they're referring to, restate the obvious, or...

...a comment, prefer improving the code: use descriptive variable/method names, extract more variables/methods to better describe what is happening, have a simple structure. However, there are things code cannot express...

...users". The red area corresponds to the records in the resulting scope. # NAND: Default behavior for Hash with multiple attributes # Excludes only users who are BOTH admins AND trashed. User.where.not...

...points to an Array of values, Rails applies standard SQL NOT IN logic. This behaves effectively as a NOR condition relative to the values in the array (neither A nor...

Event listeners are called in the order of their registration: button.addEventListener('click', () => console.log("I run first")) button.addEventListener('click', () => console.log("I...

makandra dev
developer.mozilla.org

The standard way to abort async code is that your function takes a AbortSignal { signal } property. The caller can use...