Faking Flexbox with legacy techniques
Flexbox is now available in all major browsers. Use it.
Flexbox is great Show archive.org snapshot , but you don't get reliable support in Internet Explorer.
The attached article Show archive.org snapshot shows how to accomplish many Flexboxish effects without actually using flexbox statements.
Related cards:
Classic CSS problems that are easy with flexbox
Solved with flexbox is a collection of css problems which were hard or impossible to solve without flexbox:
- Better, Simpler Grid Systems
- Holy Grail Layout
- Input Add-ons
- Media Object
- S...
Two CSS layouting techniques compared: Flexbox vs. Grid
CSS Flexbox has become extremely popular amongst front-end developers the last couple of years. This isn’t surprising, as it has made it a lot easier for us to create dynamic layouts and align content within containers.
However, there’s a new ...
Perform HTTP basic authentication in Cucumber (with or without Selenium)
This card describes a Cucumber step that lets you say:
When I perform basic authentication as "username/password" and I visit the admin area
The path component ("... the admin area") is parsed through your path_to
helper in `features/s...
Faking and testing the network with WebMock
An alternative to this technique is using VCR. VCR allows you to record and replay real HTTP responses, saving you the effort to stub out request/response...
Legacy CarrierWave: How to generate versions with different file extensions
We use CarrierWave in many of our projects to store and serve files of various formats - mostly images. A common use case of CarrierWave's DSL is to "proce...
Freeze (vendor, unpack) a single Ruby gem with and without Bundler
When you need to patch an existing gem, one way is to "vendor" the gem by copying it into the vendor/gems
directory of your Rails project. You can then make any changes you require and Rails will use the vendored version of the gem after a serve...
Working with or without time zones in Rails applications
Rails supports time zones, but there are several pitfalls. Most importantly because Time.now
and Time.current
are completely different things and code from gems might use one or the other.
Especially configuring an application that cares only...
PSA: When Redis (on LRU noeviction) reaches memory limits, keys with (any) expiry are removed, and keys without are not
In production, you (or your ops team) should configure a maximum number of bytes that Redis can use to store data (maxmemory
setting).
They may even want to set maxmemory-policy
to noeviction
to avoid keys being removed that you want to keep...
What's wrong with defining JavaScript variables within if blocks? - Stack Overflow
Because javascript has something called "Hoisting" which makes your code do things it doesn't look like it should be doing. Basically, that means a javascript interpreter will move all var declarations, regardless of where they are in the body of ...
Capybara: Running tests with headless Chrome
Headless Chrome is a way to run the Chrome browser without a visible window.
Configuring Capybara
Configure the Capybara driver like this:
Capyba...