...command on a server which continues to run after the SSH session is closed. Consider systemd-run as alternative. It will turn every command in a systemd service unit:

...openssl speed` as unit run-benchmark.service $ sudo systemd-run --unit=run-benchmark openssl speed # Query the current status $ systemctl status run-benchmark.service ● run-benchmark.service - /usr/bin/openssl speed Loaded: loaded (/run/systemd/transient/run-benchmark.service; transient) Transient: yes

When restoring a barman PITR backup you may encounter this error: Copying required WAL segments. EXCEPTION: {'ret': 2, 'err': '/bin/sh: 1: cannot open /var/lib/barman/foopostgres/wals/00000007.history: No such file\n', 'out': ''}

...present in the wals directory of your backup. The most likely reason is that someone deleted this file in the past. If you do not need this file for restoring...

jQuery doesn't store information about event listeners and data values with the element itself. This information is instead stored in a global, internal jQuery cache object. Every time you...

...gets deleted is when you call remove() on the element that put it there! Since cache entries also have a pointer back to the element that spawned them, it is...

...default to using the element as the main document viewport. In CSS, prefer to set overflow properties to html (or :root). Scrolling the main viewport with JavaScript

...main document viewport is also scrollable by default. The element that corresponds to the main viewport is either (document.documentElement) or (document.body). Which one depends on the browser.

masilotti.com

Slow test suites are a major pain point in projects, often due to RSpec and FactoryBot. Although minitest and fixtures are sometimes viewed as outdated, they can greatly improve test...

We adopted a project using minitest and fixtures, and while it required some initial refactoring and establishing good practices, the faster test suite was well worth it! Stick with...

Add apt source: apt update -y && apt install -y gpg sudo wget curl sudo install -dm...

.../etc/apt/keyrings wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null echo "deb [signed-by=/etc/apt/keyrings/mise-archive-keyring.gpg arch=amd64] https://mise.jdx.dev/deb stable main" | sudo tee /etc/apt/sources.list.d/mise.list

SVG is an acronym for "scalable vector graphics". SVGs should be used whenever an image can be described with vector instructions like "draw a line there" or "fill that space...

...they're not suited for photographs and the like). Benefits are the MUCH smaller file size and the crisp and sharp rendering at any scale. It's a simple, old...

...s calc(100 - l)); Here is what happens: from currentColor tells hsl() to start with the value of currentColor. calc(h + 180) rotates the color hue by 180 degrees, i.e...

...to the opposite of the color wheel. s keeps saturation unchanged. calc(100 - l) inverts lightness. For example, 0% becomes 100%, and 100% becomes 0%. Example usage .demo { --inverted-color...

makandra dev

...or position: fixed display: inline-block display: table-cell overflow: (not "visible") and more, see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context Example: A fluid main area with a right sidebar

...you don't want either column to clear content of the other. Float the sidebar to the right and you're set: its content now renders in the sidebar's...

adobe.com

Flash movies (.swf files) can talk with Javascript code embedded in the same HTML page. There are two ways to do this: The preferred way is to use the ExternalInterface...

...ActionScript by calling SetVariable(name, value) on the Flash movie's DOM element. This is super-legacy, but still encountered in the field. Note that communication between a Flash movie...

If your railscomplete-deployment uses the net-ssh-gem please ensure you use version 5.2.0 or newer to ensure you can deploy via Capistrano. It's best to use...

To completely remove the old host key on the client run: # remove host entry ssh-keygen -f "$HOME/.ssh/known_hosts" -R appserver.makandra.de # remove IP entry ssh-keygen -f "$HOME/.ssh/known_hosts" -R $(getent...

...not be observable by non-jQuery code. This is currently a WONTFIX for jQuery (see closed issues #2476, #3347). Native events always work for everyone Note that if you trigger...

...listeners using jQuery's trigger(). Note that you might use third-party libraries like select2 that use trigger(). If your entire app is written in jQuery and you don't...

When storing floating-point numbers such as prices or totals in an SQL database, always use a DECIMAL column. Never use FLOAT or kittens will die. DECIMAL columns are parametrized...

...with a precision and a scale. These parameters describe which numbers can be stored in that column. E.g. a decimal with a precision of 5 and a scale of...

...a minifier that is good enough for most cases. If you're looking to squeeze out as many bytes as possible, you can consider compressing with Terser instead.

...will increase your build times significantly, but produce the smallest output: Terser (3 pass) Terser (1 pass) esbuild application.js 163.6 kB 163.7 kB 181.6 kB application.js (gzipped)

There is an option you can set so that when using the cd command, small typos are automatically corrected. Add the following to your ~/.bashrc: # cd: autocorrect small typos and...

shopt -s cdspell Example: cd Porjects # Projects pwd # /home/judith/Projects Also, I recommend adding aliases for your most common typos of commands you regularly use to your ~/bashrc...

...T06:22:17.484221 #2698200] INFO -- : [53a240c1-489e-4936-bbeb-d6f77284cf38] more Goal When searching through Rails logs on production, it's often hard to see all lines that belong to...

...the same requests, since output of different requests is often interwoven. Instead, we want to find all requests that match a pattern, and then print all lines that share the...

...the new way to do it, and it's great, especially in combination with Sprockets (or Propshaft on Rails 7). You might be missing some convenience features, though.

...cover one specific issue: Once you have started your development Rails server and esbuild with the --watch option (if you used jsbundling-rails to set up, you probably use bin/dev...

Sometimes you want git to ignore certain files that appear on your machine. You can do this in 3 ways: Per project, in the project's .gitignore file

Downsides of per-project .gitignore entries While it might be tempting to set it per project (other devs might benefit from it), you need to do it each...

Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread. For instance, the following code uses 3 database connections: 3.times do

...a new connection end end These three connections will remain connected to the database server after the threads terminate. This only affects threads that use ActiveRecord. You can rely on...

A severe bug was found in ImageMagick by Bryan Gonzalez from Ocelot Team. It allows to embed the content of an arbitrary remote file when ImageMagick parses PNG files.

...on updated Packages for Ubuntu (https://ubuntu.com/security/CVE-2022-44268). Due to that we patched our systems as follows: Ubuntu 22.04: Get package source on a Ubuntu 22.04 system: apt-get source...

...method to automatically compute an ETag from the given record, array of records or scope of records: class UsersController < ApplicationController def show @user = User.find(params[:id]) fresh_when @user

...by passing an array of ETaggable objects to fresh_when. class UsersController < ApplicationController def show @user = User.find(params[:id]) # The show template also renders the user's posts. fresh_when...

...table, two things happen: Rails tries to load all involved records in a huge single query spanning multiple database tables. The preloaded association list is filtered by the where condition...

...you only wanted to use the where condition to filter the containing model. The second case's behavior is mostly unexpected, because pre-loaded associations usually don't care about...

w3c.github.io

Here is how to use Chromedriver without libraries like selenium-webdriver. This can be useful for debugging. The following example visits a web page and reads the a headline's...

...things you can do with it, but performing more advanced tasks without a tool like selenium-webdriver can be quite difficult. However, for simple debugging or remote-controlling, curl might...

Terser is a really good minifier ("compressor") for JavaScript code. I'm often surprised by the thoughtfulness of its compressed output. Let's take this function: function fn() {

...this to the following code: console.log(a||b?"foo":c()) Note how: The if statement has been replaced by a tertiary expression. This is often less readable, but it doesn...