Below is a strict, but still workable Content Security Policy for your Ruby on Rails project. Use this CSP if...

You might wonder which CSP directive applies when an allowed script makes a dynamic import: await import('other-script.js')

api.rubyonrails.org

When working with file uploads, we sometimes need to process intrinsic properties like the page count or page dimensions of...

I recently encountered this error as I was trying to build assets: $ node esbuild.config.js .../node_modules/esbuild-plugin-browserslist/dist/resolveToEsbuildTarget.js:43 throw new Error('Could...

makandra dev

Postgres supports multiple built-in range datatypes: int4range int8range numrange tsrange (range with timestamp without timezone) tstzrange (range with timestamp...

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

In rare circumstances, you want to use a websites full domain (say https://mywebsite.com) while testing in dev mode. This...

TypeScript basically uses structural typing, which is conceptually quite similar to duck typing, but with static compile-time type checking...

Leaving old unused DB columns around after a migration is confusing for other developers. However, dropping columns too eagerly might...

I use the Gemini web chat interface quite extensively. One thing that is tedious is giving it all the context...

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

I recently had to update a few selective npm libraries in a project that uses pnpm to apply a CVE...

Sometimes you have a maintenance script where you want to iterate over all ActiveRecord models. Rails provides this out of...

When creating a database table for a join model without further importance, you can use Rails' create_join_table:

When you query the browser for DOM elements, there are some footguns you should know about. Some lists are synchronized...

Finding changes When you're looking for a specific change in Git, there are multiple axes you can choose:

When you replace parts of the DOM with new HTML, using .innerHTML = newHtml is usually the simplest and fastest option...

Most of the time, it's a good default to add a unique index on the foreign key when using...

Full-text search can reach its limits in terms of flexibility and performance. In such cases, trigram indexes (pg_trgm...

unpoly.com

Quick guide for frequently used compiler selector patterns of Unpoly. 1. BEM Component Pattern When: Reusable UI components with multiple...

docs.zizmor.sh

The linked tool can be used to scan your CI/CD workflows for potential security issues and suboptimal defaults if they...

In Rails 8 the behavior of the rails db:migrate command has changed for fresh databases (see PR #52830).

I had to modify the time for an application that I launch through Docker. Here is an approach that worked...

prettier calls itself an opinionated code formatter. I recommend using it for your JavaScript and TypeScript code. prettier only concerns...