In medium-sized to large Rails applications, asset compilation can take several minutes. In order to speed up deployment, asset...
There is a kinda secret, yet well supported CSS feature called currentColor. It's like a special CSS variable that...
CarrierWave comes with some RSpec matchers which will make testing more comfortable. Let's say you have an Uploader like...
Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...
When you need test images, instead of using services like lorempixel or placehold.it you may generate test images yourself.
Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due...
When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...
If you want to make a screenshot of a website that works well in print or on a high-DPI...
This cucumber step is useful for testing an image (looking at the src of the image). Then(/^I should see...
TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...
wrap the text with a span use line-height for the spacing between lines ("margin")
You are not using javascript tests The file is served from a public folder (not via controller) Problem description...
Slides for Henning's talk on Sep 21st 2017. Understanding sync vs. async control flow Talking to synchronous (or "blocking...
Let's say you have a folder images and want to to move all files in there to a new...
Hack to implement an inverted "night mode" theme with a few lines of CSS. Colors in images are preserved.
If you want to ssh into your vagrant box without switching into the project directory and typing vagrant ssh, you...
Sometimes you add Paperclip image styles, sometimes you remove some. In order to only keep the files you actually need...
ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png
When storing a file with Carrierwave, it is always cached prior to actually storing it (to support form roundtrips).
This is useful if, for example, you want to use a background-image that has to scale with the width...
When you load a dump for development, records may reference images that are not available on your machine.
Some pseudo-elements need to be addressed with vendor prefixes. E.g. ::selection is not supported by Firefox, you need to...
ImageMagick has a command line tool called identify which can read image metadata: >identify -verbose DSC00136.JPG Image: DSC00136.JPG Format: JPEG...
Barby is a great Ruby gem to generate barcodes of all different sorts. It includes support for QR codes via...