...default: 3.0.1) It is still possible to have newer version of a gem installed beside the default version: gem install strscan Fetching strscan-3.0.3.gem Building native extensions. This could take a...
Open a MySQL root shell and use this command: PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 3 DAY) + INTERVAL 0...
Say you wrap your index view in a form to apply different filters like pagination or a search query. On...
...will happen and will have effect. But what we can observe is that the behaviour of the callback function :my_method does not happen in the test, as if the...
First install Node.js / npm. Then you can install Bower through npm: sudo npm install -g bower
...sends out transactional e-mails to a large number of users, e-mail deliverability becomes an issue. E-mail providers work hard to eliminate spam and have put in place...
...No staging sandbox No permission system for api keys No authentication mechanism for webhooks besides IP ranges Buggy admin UI SendGrid Pro: Very good deliverability Not quite as expensive
Though the W3C even gives it as an example, no browser actually supports this CSS: img:before { content: "something"; }
...i.e. one transaction can see most of what another is doing), and SERIALIZABLE the best (i.e. transactions are very well isolated). Conversely, READ UNCOMMITTED gives you the best performance, while...
...will be the slowest, due to a lot of locking. This also affects locking behaviour and replication performance. The default level is REPEATABLE READ, and it's the mode you...
Due to network or hardware failures, it can happen that one of your cronjobs will not run at the time...
We had a card that described how to install multiple mysql versions using mysql-sandbox. Nowadays with the wide adoption...
...purpose of this card. Update it once a day (using whenever) Tip Consider the best place to put the new logic. Should it be an existing class or new classes...
...plain RSpec mocks ("stubs") to replace the HTTP request to the API with scripted behavior. Can you minimize the number of lines of code that now no longer run during...
...addresses = AddressBook.new addresses.add Contact.new(first_name: 'Frederik', last_name: 'Foo') addresses.add Contact.new(first_name: 'Berta', last_name: 'Beispiel', phone: '556677') addresses.add Contact.new(first_name: 'Anna', last_name: 'Muster', street: 'Foo...
...returns contacts that match all of the words in any property: results = addresses.search('77 berta') results.size # => 1 results[0].first_name # => "Berta" Errors Change the AddressBook class so the #add...
Newer versions of Bundler (at least since 2.3) have two different behaviors: If your Gemfile.lock reads PLATFORMS: ruby, it might either install a compatible platform-specific version...
...or similar), bundler will install exactly the versions indiciated in the Gemfile.lock. Fix For better consistency, I would advise to make sure you always have PLATFORMS x86_64-linux
...use version 5.2.0 or newer to ensure you can deploy via Capistrano. It's best to use the latest version, as there were multiple issues between 5.2.0 and 7.3.0.
For searching in large database tables we usually use PostgreSQL's fulltext search capabilities. While this works reasonably well for...
To delete a certificate request run sudo puppet ca destroy $your.full.hostname on your puppetmaster.
If your app does not need to support IE11, you can use most ES6 features without a build step. Just...
...Just take a step back and evaluate its usefulness first. Also, consider if its benefits outweigh the cost of teaching and maintaining the new thing. Being a good open-source...
We are using the BEM pattern ("Block, Element, Modifier") to structure our CSS in all new projects. We try to migrate legacy projects to BEM, block-by-block. Read
...it important modifiers start with -? More examples Look at some examples of a good BEM structure in the DOM tree of these websites: https://makandra.de/ https://railslts.com/ https://www.aitiraum.de/
ActiveModel supplies an errors object that behaves similar to a Hash. It can be used to add errors to a record, as well as to query the record for registered...
...multiple subsequent occurrences of a given character with a single one Use Tap For Better Test Data Setup let(:order) do create(:order, name: "My Order").tap do |order|
If you use third party APT sources you might end up with unmaintained packages after removing the external source or...
You can report CSP violations to a log file. Note that there will be a lots of noise, that is...
Ruby 3.0 introduced a breaking change in how it treats keyword arguments. There is an excellent blog post on the...