The Rails asset pipeline improves delivery of application assets (javascripts, stylesheets, images, fonts). Here are some basic facts about its...
Clamps (ie. cuts off) an HTML element's content by adding ellipsis to it if the content inside is too...
The asset pipeline changes the paths of CSS files during precompilation. This opens a world of pain when CSS files...
We upgraded a Rails 2 application to Rails 3.2 and Ruby 2.1, changed the mysql adapter from mysql to mysql2...
PDFKit converts a web page to a PDF document. It uses a Webkit engine under the hood...
Styling HTML email is painful. Tables, inline CSS, unsupported CSS, desktop clients, web clients, mobile clients, various devices, various providers...
See attached link. The gist is: .element { position: relative; top: 50%; transform: translateY(-50%); } Works in all web browsers and...
Be careful to name any file @imported by SASS with a leading underscore. SASS files not beginning with an underscore...
SudoSlider is a simple yet powerful content slider that makes no (or very few) assumptions about your markup and is...
When you cannot make Selenium trigger events you rely on (e.g. a "change" event when filling in a form field...
I use this to simulate the (non-existing) :last-letter CSS pseudoclass, e. g. to insert a tombstone at the...
The error unexpected 'x' after 'DESCENDANT_SELECTOR' (Nokogiri::CSS::SyntaxError) (where x may be basically any character) occurs when the...
When using @media CSS queries, Internet Explorer 8 and below will fail to respect them. Though there are several options...
When you want the table headers to always stay around (e.g. because that table is huuuge), use the code below...
Check out the jsFiddle Demo. CSS .absoluteCenterWrapper { position: relative; /* Declare this element as the anchor point for centering */ } /* Positioning */ .absoluteCenter...
Ask before leaving an unsaved CKEditor Vanilla JavaScript way, but removes any other onbeforeunload handlers: $(function(){ document.body.onbeforeunload = function() { for(editorName...
Make your custom web font available Add to ckeditor/config.js CKEDITOR.editorConfig = function(config) { config.contentsCss = [ '/assets/myCkeditorStyles.css', // any other file to encapsulate custom...
RulersGuides.js is a Javascript library which enables Photoshop-like rulers and guides interface on a web page Also available as...
Non-static elements will not inherit their parent's opacity in IE for no good reason. This can lead to...
Crazy hack. Might be useful one day. The code required has since been extracted into a library.
Clever hack to allow user interaction without Javascript (by using radio buttons and selecting on :checked).
Give the table a style table-layout: fixed Give the cells in the first row a width The same width...
Setting the colorbox opacity by hash parameter when initializing doesn't work the way like the documentation tells you.
An annoying part of using font icons is that the icons usually need to live in the DOM. This is...