Are My Indexes Affected? If your database has been created on an operating system with glibc version < 2.28 and later upgraded to an operating system with glibc >= 2.28, you...
...affected. To find out which indexes in our database are affected, run the following slightly modified query from the PostgreSQL documentation: CREATE extension amcheck; SELECT bt_index_check(index => c.oid...
...in the context of our application. While you could roll out a custom authentication solution, this would likely expose you to the various risks of "homegrown crypto". In practice we...
...like clearance or devise for this task. Learn Read the article Rails Authentication from Scratch You don't need to do write any code, but you should be able to...
When you find similar groups of expect calls in your tests, you can improve readability by extracting the group into its own matcher. RSpec makes this easy by allowing matchers...
We can extract the repeated matcher chains into a custom matcher called be_shouting: expect(foo).to be_shouting expect(bar).to be_shouting Instead of re-implementing the...
Intel CPUs receive updates, including security relevant upgrades, through 2 channels: Firmware/UEFI BIOS updates can also update the microcode in CPUs. This is the preferred and persistent way
How to install an microcode update? If one is available and deemed sufficiently stable from Debian's or Ubuntu's perspective, the intel-microcode package is updated and...
The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g. x86_64-linux includes binaries for 64bit Linux on Intel/AMD...
...This significantly speeds up installation of the gem, as Nokogiri no longer needs to compile libxml2. However, this also means that for each security issue with libxml2, Nokogiri maintainers have...
...good thing. It's possible to configure this requirement at the web- or proxy server level, where nginx or apache will just redirect every request on http to https. Some...
...if the URL they've been called with contains the http or the https scheme and issue their own redirect response (usually 301 or 302) to https. This card is...
If you want to switch to another ruby versions, you have several options, depending on what you want: Do you want to switch temporarily, per project, or globally?
Unlike RVM, rbenv does not offer a command like rvm use. By default, it respects your project's .ruby-version file. If you need to change manually...
Du weißt was copy-on-write ist und warum das in Zusammenhang mit Snapshots praktisch ist Du weißt was Fragmentierung ist und wann und wo es bedeutsam ist
Du weißt wie du einen Datenträger verschlüsselst Du weißt wie man ein Linux System verschlüsselt Du weißt wie man die Systeme jeweils wieder entschlüsselt Inhalte LinuxFilesystemsExplained (Achtung alt)
Because your examples should not change global state, you should not need to care about the order in which RSpec processes your .rb files. However, in some cases you might...
...rb files in alphabetical order of their file paths by default (or when you specify --order defined). You run tests in random order by using --order random on the command...
While it might seem trivial to implement an invoice that sums up items and shows net, gross and vat totals, it actually involves a lot of rules and caveats. It...
...examples in Ruby and MySQL, the concepts apply to all programming languages and data stores. When to round There are exactly two spots where your invoice logic should round money...
When you use method_missing to have an object return something on a method call, always make sure you also redefine respond_to_missing?. If you don't do it...
def method_missing(method_name, *args, &block) if method_name == :bark 'woof!' else super end end end This will allow you to say: Dog.new.bark => "woof!" But: Dog.new.respond_to? :bark...
...issues, depending on the exact version, and depending on your app. However, it is still possible to give some generic advice on how you want to tackle the update in...
...really confident about upgrading Rails, have a look at Rails LTS. How many update steps? Besides the Rails upgrade itself, you might also want to upgrade your other gems and...
If you need to convert an SVG source to PS or EPS, the most common suggestion on the interwebs is to use Inkscape from the commandline. Inkscape is a fairly...
...converting is CairoSVG. CairoSVG is available on most Linux distros through their package management systems, e.g. apt install cairosvg on Ubuntu. It has few dependencies (most importantly Python 3 and...
...that matter) will not be affected by this. If you define them in your specs, they will exist globally. This is because of how RSpec works (short story: instance_eval...
# ... end let(:record) { TestRecord.new }
end # TestRecord will exist here, outside of the spec! Do not do this. It will bite you eventually. For example, when you try to...
You have uncommited changes (you can always check by using git status), which you want to discard. Context Now there are several options to discard these depending on...
...your exact situation. The headlines will differentiate the cases whether the files are staged or unstaged. Staged and unstaged changes Staged changes Unstaged Changes Staged and unstaged changes
...tough challenge. To get more detailed insights consider using the rack-mini-profiler gem. Setup with Unpoly Add the following gems: group :development do gem 'memory_profiler' gem 'rack-mini...
If you have slow views (Haml/Partials can be slow), consider caching them. Remove code & sql-queries that are not needed to render the page. Calling to_a blindly on...
...files. Those can be used to apply to a different repository [1] or by someone else (e.g. sent when sent to them via e-mail). Creating a patch in git...
...changes and commit them. Run git format-patch COMMIT_REFERENCE to convert all commits since the referenced commit (not including it) into patch files. For example, let's say you...
I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method on Enumerable that combines the three: module Enumerable
group_by(&block) .transform_values(&:count) .sort_by(&:last) .to_h end end Just paste that snippet into a Rails console and use #count_by now! Usage examples...
Read the following material: World's shortest UI/UX design course Easiest Way to Pick UI Colors 7 Rules for Creating Gorgeous UI (Part 1) 7 Rules for Creating Gorgeous...
Visual design rules you can safely follow every time Bootstrapping Design (in our library) Steve Schoger's Refactoring UI book (in our library) and watch the following...
...und bedienen im DevOps- & Cloud-Bereich primär Kunden, die ebenfalls auf Linux als Ziel-System setzen. Entsprechend benötigen wir tiefgehendes Wissen über Linux. In diesem Kapitel lernst Du alles zum...
...Hintergrund und ein wenig Theorie zu Prozessen, Speicher, Konfiguration und viel praktisches zur Konfiguration, Ressourcenüberwachung und abschließend eine Anleitung zur Performance-Analyse von Unix-basierten Systemen in 60 Sekunden.
Why string sorting sucks in vanilla Ruby Ruby's sort method doesn't work as expected with special characters (like German umlauts): ["Schwertner", "Schöler"].sort # => ["Schwertner", "Schöler"] # you probably expected...
...Schöler", "Schwertner"] Also numbers in strings will be sorted character by character which you probably don't want: ["1", "2", "11"].sort # => ["1", "11", "2"] # you probably expected...
...to read the The framework field guide - Fundamentals, the first of a three part series to learn the basics of frontend technologies. I can highly suggest it for learning the...
...fundamentals. 'The framework field guide' is written by Unicron Utterances and there side has many high quality articles on web development and computer science related to programming. The Framework Field...
How can I configure virtual IP's? There are two parameter to set up virtual ips in Keepalived: virtual_ipaddress Addresses defined here are included into the VRRP Packages and...
...specified interface instead of the one in `interface. Why are the floating getting dropped by systemd-networkd/netplan? Read Prevent systemd from dropping IP-Addresses configured from other processes.
...pretty_print method As an example, consider the following class. class MyClass # ... def inspect "#<#{self.class} attr1: #{attr1.inspect}, attr2: #{attr2.inspect}>" end end Instances of that class will inspect like #<MyClass attr1...
...Alice", attr2: "Bob">, but IRB will apply a single color (green) for everything. That is because MyClass implements only inspect. If it were to implement pretty_print, IRB would use...