digitalocean.com

I recommend install Node.js using nvm. This way you can have multiple Node versions in your ~/.nvm. You also won...

Getting an entire test suite green can be a tedious task which involves frequent switches between the CLI that 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...

...the old versions you wish to remove. Keep at least one recent, working kernel besides the one you are currently running. Address Metapackage Conflict (GA vs. HWE)

makandra dev
github.com

...holds your bash prompt. You might want to change it to serve your needs best. Here is how to: General non-printing escape sequences in your prompt have to be...

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

...blocks or confusingly sometimes also procs Those with "method semantics", called lambdas lambdas They behave like Ruby method definitions: They are strict about their arguments. return means "exit the lambda...

...the lambda literal -> (since Ruby 1.9.1) test = ->(arg) do puts arg end blocks They behave like do-blocks or simply "segments of code": They try to be smart about their...

end end def allowed_mime_types %w(image/jpeg image/png) end end This will behave like the solution before: User#portrait will get an expected error message and the User...

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

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

makandracards.com

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

In Capistrano 3, your Capfile requires 'capistrano/rails/migrations', which brings two Capistrano tasks: deploy:migrate and deploy:migrating. The former checks...

...changes it for the current repository. Since it's hard to remember which project behaves how, you should find a suitable global setting. Regardless which option you use you can...

...current branch. Caveat with current For most of us, current is the safest push behavior. However, it has a small side effect: When a branch with your local name does...

Here is a bash script that I use to auto-configure displays on Ubuntu 24.04 with Xorg. Background

mysqlperformanceblog.com

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

When loading a database dump created with pg_dump into your database, you might run into an error like

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

...visibilitychange event to be notified if visibility changes. This allows your background tab to become completely passive: function pulse() { // do expensive thing } let pulseInterval function schedulePulse() { if (document.hidden) { if (pulseInterval...

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

Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...

The DB schema is the most important source of truth for your application and should be very self-explanatory. If...