tl;dr The :is() pseudo selector - specificity of its most specific argument - matches against a comma-separated list of selectors...
use Postgres' lower() function add an index on lower(email) Probably the best approach is to just convert emails (and usernames) to lowercase within Rails. Popular authentication libraries...
While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...
The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...
You can not use the hash_including argument matcher with a nested hash: describe 'user' do let(:user) { {id: 1...
tl;dr The :where() pseudo selector - zero specificity - matches against a comma-separated list of selectors. Example Compound selectors like...
This may be awkward to set up, but will work once you're done. Fun facts:
Recently we detected a memory leak in one of our applications. Hunting it down, we found that the memory leak...
s keeps saturation unchanged. calc(100 - l) inverts lightness. For example, 0% becomes 100%, and 100% becomes 0%. Example usage .demo { --inverted-color: hsl(from currentColor calc(h...
In some projects we have issues with flaky tests. The best default is to fix them all. But in some cases it might be a pragmatic way to retry them...
This page lists many query methods and options in ActiveRecord which do not sanitize raw SQL arguments and are not...
Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...
Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...
For string columns, MySQL indexes the left side of a string. That means an index can speed a like query...
...record, :match_requests_on).except(:example_group) VCR.use_cassette(name, options) { example.call } end end Behaviour If a spec is not tagged with :vcr, VCR will complain about any attempted HTTP...
...request. This is the default behaviour. If you want to turn this off temporarily, e.g. to communicate with an actual API while writing a new spec, simply add the line...
...a? Capybara::Driver::Selenium Now the selenium driver is located by Capybara::Driver::Selenium. A better-looking approach would be: Capybara.current_driver == :selenium page.response_headers['Content-Disposition'] should be page.response.headers...
When using Sidekiq in your application, you must write thread-safe code. This wiki page also lists gems that are...
...more information about this issue. In Rails3+ you can also disable this annoyingly clever behavior. Why this is bad This has some develish implications for your deployment, because scopes written...
...t notice this during development. Let's say you have a model Note which belongs to an Author and has a string column category: class Note < ActiveRecord::Base
...lockfile carefully when submitting a commit. Note that the approach in this card works best, if you use yarn outdated or npm outdated together with yarn upgrade some_package or...
Some users might use Adblock Plus or similar browser plugins to reduce the number of ads displayed. If you run...
Sidekiq 7 adds a new feature called capsules. Use cases: a chrome queue limited to 1 for e.g. PDF processing...
...all routes, but may return early, a change has been introduced to add lazy behavior by adding an iterator block and yielding. This change breaks the adapter patch in routing...
...any cleanup yourself. Why? Understand this: before(:context) is run when the context/describe block begins, before(:context) is run outside of transactions, so data created here will bleed into other...
...API design, I thought it might be nice to write down a set of best practices. And poke fun at a couple widely-used APIs. Much of this may be...