So you want to know if you are on natty, precise, quantal, or something else? Check /etc/lsb-release. $ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=12.04 DISTRIB_CODENAME=precise DISTRIB_DESCRIPTION...
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...
...can view with crontab -l and edit with crontab -e. You'll need to su to the respective user to view or edit her crontab...
...You very likely have a model that has a delay attribute. You can configure Sidekiq to remove its delay method by adding this to your Sidekiq initializer: Sidekiq.remove_delay!
...you need to keep Sidekiqs delay features, add Sidekiq.hook_rails! before the option above. The sidekiq methods will be prefixed with sidekiq_ then...
...to do a VACUUM FULL without holding an exclusive lock during processing. There is still a need of one exclusive lock at the beginning and the end of the repacking...
...affected table. Warning pg_repack writes a copy of the whole table. The database server needs to have at least ($size_of_biggest_table * 2) + some buffer free disk space...
Much of our work is on applications that are old or were built by someone else. This lesson covers how we make such applications stable and pleasant to work on...
Learning goals You can explain how legacy applications become complex, and why keeping software simple is hard. You can explain our approach to adopting a legacy app: end-to...
...good UI design, you should always be able to come up with a default. Since the user interface makes up 70% of a typical web application, this is closely related...
...the client has none, by modelling every interaction as CRUD on a resource — index, show and forms — and placing collection-level and record-level actions where users expect them.
This card is a general reminder to avoid the short version of a command option in shared code. It's much easier to understand a command and search for an...
...option when it's written out. You can still use the short version of the options in your own terminal or in code snippets that are more useful when they...
Important Work on this lesson in builder mode. Jasmine is a purely client-side tool. It cannot ask Rails to render a view or access the database. Any HTTP...
You can explain what JavaScript unit tests cover that end-to-end tests shouldn't: a component's details and edge cases, without a server or a database.
...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...
...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.
These warnings are printed when the etc Gem is installed, while etc is also included in Ruby. Fix with:
...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...
...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...
Our workstations and servers run Linux. This lesson covers the command-line tools you need every day, from file and process handling to SSH and shell scripts. Important
...this lesson in advisor mode. Learning goals You can look around a Linux system from the shell: files and directories, running processes, disk usage, open network ports, installed packages.
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...
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...
...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...
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...
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...