...some behavior you may eventually run into when upgrading your application. This aims to save you some time understanding what happens under the hood to possibly discover problems faster as...
...renamed to denylists. You will have to rename all occurrences in your code. Make sure that you have defined a trait for validating the extensions and content types in all...
These warnings are printed when the etc Gem is installed, while etc is also included in Ruby. Fix with:
...locale files. This lesson covers how to use it, why it is useful even for single-language apps, and how to test it. Important Work on this lesson in builder...
...organized in locale files. You can explain why locale files pay off even in a single-language app: model and attribute names, formats and error messages live in one place...
Many applications let users upload files. This lesson covers storing uploads as model attributes with CarrierWave, generating image versions, and testing uploads. Important Work on this lesson in advisor mode...
You can explain how an uploaded file travels from the browser to the server (a multipart form post) and where a Rails app can store it.
...are automagically available through accessors on the Active Record object. When you need to specialize this behavior, you may override the default accessors (using the same name as the attribute...
...and simply call the original implementation with a modified value. Example: class Poet < ApplicationRecord def name=(value) super(value.strip) end end Note that you can also avoid the original setter...
Although regular expression syntax is 99% interchangeable between languages, keep this in mind: By default, the dot character (".") does not match a line feed (newline, line break, "\n") in any...
...use the /s modifier in Ruby. It changes the RegExp to interpret text as Shift JIS encoded which you probably don't want. Javascript There is no modifier to make...
...lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID) $~ (MatchData from last successful match) ...and many more you'll need when reading weird...
$1 $2 $3 $4 (match groups from the last pattern match) $& (last matched string) $+ (last match group) `$`` (the string before the last match) $' (the string after the last match...
As developers we are dealing with many tasks every week. We need a system to organize ourselves. Important Work on this lesson in advisor mode. Learning goals You can explain...
...or a todo.txt). You can break a task or project down into actionable first steps. You finish tasks before you start new ones, so your list doesn't fill up...
...application remembers a user between requests. This lesson covers how cookies work, how Rails sessions build on them, and what signed, encrypted and SameSite cookies protect against. Important
...would change if we stored it in the database instead — and what would break for signed-out visitors...
Systemd's networkd will drop IP-Addresses configured by other processes like Keepalived's VRRP, when it is restarted. This may happen on updates. To prevent this following settings are...
...critical: yes to /etc/netplan/50-cloud-init.yaml eth1: addresses: - 192.0.2.67/24 gateway4: 192.0.2.1 nameservers: addresses: - 198.51.100.42 - 198.51.100.53 search: - example.lcal critical: yes run netplan generate This will add the CriticalConnection to your networkd configuration...
Fixed bugs where calling valid? would change the record's state...
...the code below to check whether the browser can make connections to the current site: await isOnline() // resolves to true or false The code The isOnline() function below checks if...
...you can make real requests by re-fetching your site's favicon. If the favicon cannot be downloaded within 6 seconds, it considers your connection to be offline. async function...
...you want to automatically delete old container images from your Elastic Container Registry, the solution is a quite simple ECR Lifecycle Rule that deletes images e.g. 7 days after they...
...is a floating tag always associated with the image currently deployed to production, the situation suddenly is not so simple any more. ECR does not provide a keep action in...
...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...
...of different file types including: Ruby (business logic) HTML fragments (layouts and views) CSS/Sass/SCSS (styles) JavaScript (client-side behavior) Static media (images, fonts, videos) Except for the Ruby part, all...
...to make your application assets cachable in Rails — our card; fingerprinting and cache headers 📄 JavaScript start-up optimization: network — why bundle size and count matter 📄 yarn 1 documentation — the package...
...implementation changes. The information below is validated for the current list of browsers we support. By default your html and body elements are only as high as the actual page...
...html and body elements will only be around 40 pixels high, regardless of the size of your browser window. You might be surprised by this, since setting a background on...
...can explain why we create test data with factories instead of fixtures: each test starts empty and creates only what it needs. You can define factories with sensible defaults, using...
...gems like FactoryBot, and use them in specs with overrides. You can define factories for associated records, and avoid creating duplicates where a record should be reused.
In case you're wondering, when concat-ing server certificate and intermediate certificates, the server certificate comes first. RFC 4346: certificate_list This is a sequence (chain) of X.509v3 certificates...
certificate must come first in the list. Each following certificate must directly certify the one preceding it...
...programming language we use on the backend. This lesson takes you from your first script to classes, blocks and custom errors — the working vocabulary for everything that follows. Important
...on this lesson in teacher mode. Learning goals You can write and run a small Ruby program that reads input (e.g. arguments or a file) and prints output.
...where they happened. Understanding this lets you handle events for many elements with a single listener, including elements that don't exist yet. Important Work on this lesson in advisor...
...how a DOM event travels through the tree — capturing, target, bubbling — and which listeners see it in which order. You can explain the difference between event.target and event.currentTarget.
...possible to only use -f pretty for the rerun. Drawbacks: MAJOR: With our current setup, when the main run fails without writing a tmp/failing_features.txt (e.g. due to a syntax error...
...the CI job will pass MINOR: With our current setup, we lose the test coverage of the main run A fix for the passing CI despite syntax error could look...
This is super stupid: In the Thunar file manager, select the file Go to File / Properties / Open With (WTF!) Select the preferred application from the list and hit "Set default...
...This setting will apply to all files with that extension...
...desktop users may encounter some weird quirks: Aside from allowing only digits and decimal separators, an "e" is also allowed (to allow scientific notation like "1e3"). Non-technical users will...
...be confused by this. Your server needs to understand that syntax. If it converts only digits (e.g. to_i in Ruby) you'll end up with wrong values (like...
When building an application that sends e-mails to users, you want to avoid those e-mails from being classified as spam. Most obvious scoring issues will not be relevant...
...to you because you are not a spammer. However, your application must do one thing by itself: When sending HTML e-mails, you should include a plain-text body or...