The basic idea is pretty simple: an element's height is accessible via the offsetHeight property, its drawn height via...

makandra dev
httpd.apache.org

Debugging .htaccess is hell, and RewriteRules in particular if they are not working as expected. But fear not! RewriteLog will...

ActiveRecord has a feature called counter caching where the containing record in a has_many relationship caches the...

When you have two models in a has_many, has_one or belongs_to association, the :inverse_of option in...

Generally, Selenium tests use the browser to interact with the page. If it's unavailable, a timeout error is...

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

When is this useful? When both parent and child elements have borders, with this technique you don't get two...

Ruby's mathn library changes Fixnum division to work with exact Rationals, so 2 / 3 => 0 2 / 3 * 3 => 0...

makandra dev

Browsing the git stash is a bit tricky. Here is how to see the changes without applying them:

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

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

makandra dev

This article describes how to reset MySQL's or MariaDB's root password on your workstation. It's meant for...

Assuming the following sunspot setup of the post class: class Post < ActiveRecord::Base searchable do text :title string :state

In Rails 3.1+, instead of defining a separate up and down method you can define a single method change:

Sometimes you need to remove high Unicode characters from a string, so all characters have a code point between 0...

In a nutshell: Capybara's find will not work properly on nodes from a list. Don't find on elements...

Why string sorting sucks in vanilla Ruby Ruby's sort method doesn't work as expected with special characters (like...

weblog.jamisbuck.org

How to get a backtrace from a running Ruby process: Ruby 2.6 # First, find out the PID of your Ruby...

I followed this nice guide Connecting to MSSQL with Ruby on Ubuntu - lambie.org until I ran in the following errors...

intridea.com

This article shows how to create a Sass mixin for a colored button. The button's foreground color is dynamically...

When your model is using a callback like before_save or before_validation to calculate an aggregated value from its...

Imagine you have 2 HTML boxes. The first one has a margin-bottom of let's say 30px and the...

In MySQL comparing zero to a string 0 = "any string" is always true! So when you want to compare a...

Imagine you have a piece of code that tries to send a request to a remote server. Now the server...