Background information about session storage in Rails Rails has a default mechanism to store the session in the CookieStore. This...

mail-tester.com

You can use mail-tester.com to check your application's e-mails for issues that might cause e-mails to be...

...styles from the document. See Styling a Web Component for this case. Applying JavaScript behavior to new elements All client-side JavaScript frameworks comes with mechanisms to activate JavaScript behavior...

...a framework mechanism you may use customElements.define() to register your custom element's JavaScript behavior with the browser directly. A big advantage of using the browser's customElements.define() is that...

It is just not worth the risk and you can always do better. Alternatives Instead, you should take a different approach. Here are several alternatives.

github.com

Note The maintenance mode is enabled on all application server as soon as the file /public/system/maintenance.html is present. Installation

It's not a good idea to leave data objects mutable. They should behave like integers. Ruby's Data would have already enforced that. Because I used a regular...

...attr}=" do |value| if @readonly raise 'Readonly' else super(value) end end end Weird behavior changes from composed_of The method composed_of accepts the option :mapping, which is required...

makandracards.com

A general overview about why and how we migrate can be found under Migrating from Elasticsearch to Opensearch

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

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

...Yourself (or DRY). In Ruby on Rails we keep our code DRY by sharing behavior by using inheritance, modules, traits or partials. When you reuse behavior you want to reuse...

...module that you include in the Cucumber world. This way the module's methods become available to all step definitions. Think of it as enhancing your Capybara API with app...

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

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

...future we will be able to transition to display: none by using the transition-behavior: allow-discrete property. This will delay the display change until the transition ends. This is...

mysqlperformanceblog.com

When MySQL refuses to use your index, there's a number of things that you may be doing wrong. One...

...hard to understand, the helpers available differ for different versions of Rails and the behavior is subtly different. Make sure you read and understand the API before using these...

makandra dev

Rails partials have a lot of "hidden" features and this card describes some non-obvious usages of Rails Partials.

makandra dev

CSS transitions are a simple animation framework that is built right into browsers. No need for Javascript here. They're...

I often see the use of || to set a default value for a variable that might be nil, null or...

makandra dev

There are several tools for DNS debugging which offer you more or less information. Most of the time the more...

makandra dev

Starting with Ruby 1.9, most #each methods can be called without a block, and will return an enumerator. This is...

masilotti.com

...from using fixtures over FactoryBot, as fixtures load essential test data upfront at the beginning of the testsuite. Finding peace with fixtures While setting up the database upfront challenges the...

...idea of maintaining a perfectly clean database state at the beginning of each test, with some disciplined practices, handling fixtures becomes quite manageable. Let’s dive into how this works...

RubyMine comes with a nice way to grep through your project's files: The finder (ctrl + shift + f). Don't...

Integration tests give the code its rough form, whereas unit tests pinpoint specific behavior. During development, you are frequently changing levels. It may look something like this: Integration _ ___

...usage example, "happy path"> # Add a scenario for each use case. Examples are: error behavior, access rights, contexts, closer looks at parts of the feature Scenario: ... (This example uses Cucumber...