Taming icon fonts for use in Rails views

Posted Over 11 years ago by Henning Koch.

Icon fonts like Font Awesome are infinitely scalable, look great on high-DPI displays and will give your app a...

CSS: Emulate linear gradients with inset box shadows

Posted Over 11 years ago by Henning Koch.

Why is this useful? You can have a background image on the same element, overlaying it with a transparent gradient...

CSS-Style

Posted Over 11 years ago by Dominik Schöler.
github.com

Richard Powell presents a collection of CSS styling advice that's mainly taken from SMACSS. Although at makandra we're...

How to not leave trailing whitespace (using your editor or Git)

Posted Over 11 years ago by Arne Hartherz.

There is no reason to leave trailing whitespace characters in your project's files, so don't add any.

Paperclip: undefined method `to_file' for #<Paperclip::Attachment:0000> (NoMethodError)

Posted Over 11 years ago by Thomas Eisenbarth.

to_file has been removed in Paperclip 3.0.1. Instead of using File to access Paperclip storage objects (like this: File.read...

`simple_format` does not escape HTML tags

Posted Over 11 years ago.

simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...

Distribute files from a private bucket on AWS S3

Posted Over 11 years ago by Thomas Eisenbarth.

Given you store files on Amazon S3 and you need to stream those files out to people while you don...

Imagemagick: Batch resize images

Posted Over 11 years ago by Thomas Eisenbarth.

Trick: Do not use convert but mogrify: mogrify -resize 50% * This overwrites the original image file. In contrast, convert writes...

How to make your application assets cachable in Rails

Posted Over 11 years ago by Henning Koch.

Note: Modern Rails has two build pipelines, the asset pipeline (or "Sprockets") and Webpacker. The principles below apply for both...

Paperclip: Move attachements from local storage to AWS S3

Posted Over 11 years ago by Thomas Eisenbarth.

We frequently use the handy Paperclip Gem to manage file attachments. If you need to move the files from local...

Beware of magic adblocker rules

Posted Over 11 years ago by Thomas Eisenbarth.

If a customer calls and tells you that she cannot see some content of her website beware of the following...

How to test print stylesheets with Cucumber and Capybara

Posted Over 11 years ago by Henning Koch.

A print stylesheet is easy to create. Choose a font suited for paper, hide some elements, done. Unfortunately print stylesheets...

Be careful when using Unicode symbols for graphical elements

Posted Over 11 years ago by Henning Koch.

There are many fun Unicode characters like ▲ or ☯. You might be tempted to use them for graphical elements in lieu...

How to fix: Firefox uses incorrect fonts on all webpages, regardless of their CSS

Posted Over 11 years ago by Arne Hartherz.

If you encounter a Firefox that does not care about your font settings but always uses specific fonts, you can...

Test your CSS rendering output with GreenOnion

Posted Over 11 years ago by Henning Koch.
github.com

No one wants to cry over regression issues in views; does testing HTML and CSS have to be such a...

LibreOffice won't embed most fonts into PDFs (with fix)

Posted Almost 12 years ago by Henning Koch.

LibreOffice Impress, Writer, etc. doesn't embed most fonts into the PDFs it generates. This means if you share a...

Rails asset pipeline: Why relative paths can work in development, but break in production

Posted Almost 12 years ago by Tobias Kraze.

When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...

Plotting graphs in Ruby with Gruff

Posted Almost 12 years ago by Dominik Schöler.
github.com

Geoffrey Grosenbach has created Gruff for easily plotting graphs. It is written in pure Ruby and integrates with Rails applications...

Mysterious "margin" below an image

Posted Almost 12 years ago by Dominik Schöler.

Consider the following HTML & CSS: ^ img { background-color: red; } div { border: 1px solid black; } This will leave a margin of...

Gimp: Why removing pixels sometimes leaves transparency, sometimes the background color

Posted Almost 12 years ago by Henning Koch.

You might have notices this behavior when you cut a selection or use the rubber tool. The behavior depends on...

Guide to localizing a Rails application

Posted Almost 12 years ago by Henning Koch.

Localizing a non-trivial application can be a huge undertaking. This card will give you an overview over the many...

Compress bitmap images within PDF files

Posted Almost 12 years ago by Thomas Eisenbarth.

Embedding bitmap images within PDF sometimes results in large files because the bitmaps are not compressed. If you don't...

Howto properly use vertical-align to align elements vertically

Posted Almost 12 years ago by Dominik Schöler.

Say you want to vertically align a div box inside a div container. This is how you do it:

IE9: Linear gradients remove border-radius and inset box-shadows

Posted Almost 12 years ago by Henning Koch.

When you add a linear gradient to an element, IE9 removes all border-radius and inset box-shadows. This is...