The asset pipeline changes the paths of CSS files during precompilation. This opens a world of pain when CSS files...
Modern browsers natively suppport file pickers that allow the user to choose multiple files at once. To activate this feature...
To avoid n+1 queries, you want to eager-load associated records if you know you need to access them...
By default git diff highlights whole lines as changes. To diff on a word-by-word basis you can say...
It's like Paperclip or CarrierWave, but without any automagic integration.
PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood...
Inspiring collection of color tones.
Safari on iOS accepts an apple-touch-icon favicon that is used for stuff like desktop bookmarks. Always define a...
The adjust-hue function of Sass allows you to change a color's hue, but only relative to its current...
SudoSlider is a simple yet powerful content slider that makes no (or very few) assumptions about your markup and is...
For me guard recently took a very long to start (as in "minutes"), because I had lots of images in...
MenuetOS is an Operating System in development for the PC written entirely in 32/64 bit assembly language. Menuet64 is released...
If you want to label things with a color but don't actually care which cholor, you can use the...
Browsers usually cache favicons. If you update the favicon of your web site and want all visitors to see the...
Eduardo Russo was tired of complex favicon creation and created his own favicon generator. It's really easy and allows...
RulersGuides.js is a Javascript library which enables Photoshop-like rulers and guides interface on a web page Also available as...
pngquant is a command-line utility and a library for converting 24/32-bit PNG images to paletted (8-bit) PNGs.
An annoying part of using font icons is that the icons usually need to live in the DOM. This is...
In Ruby, classes and modules are called constants. This card explains how Ruby resolves the meaning of a constant.
CarrierWave attachments have two distinct methods #url and #path which appear to behave the same: document.file.url # => /storage/documents/4/letter.doc document.file.path # => /storage/documents/4/letter.doc
Assert rmagick provision ... Gemfile gem 'rmagick', '2.13.2' # at this moment the latest stable version config/initializer/carrierwave.rb require 'carrierwave/processing/rmagick' ... and define a...
# Attach a file # # Example: # # Company.new.logo = File.new… # # Given the file "…" was attached as logo to the company above # # # Example: # # class Gallery...
Say you have a User with a Carrierwave attribute #avatar: class User < ActiveRecord::Base mount_uploader :avatar, AvatarUploader end
When I upgraded from 0.5.4 PDFKit deadlocked or crashed when an ApplicationController::RouteError occured. If this error happens only because...