ariejan.net

Rails understands a :limit options when you create columns in a migration. Its meaning depends on the column type, and...

tl;dr: Do not use merge! for session hashes. Use update instead. Outline Let's assume you're modifying the...

JavaScript has no built-in functions to compare two objects or arrays for equality of their contained values.

apidock.com

Ruby 1.9 changed the default behavior of Module.const_defined? from what it was in Ruby 1.8 -- this can be especially...

gist.github.com

Rails 2.3.16+ on Ruby 1.9 causes warnings like this: .../gems/activesupport-2.3.17/lib/active_support/core_ext/string/output_safety.rb:22: warning: regexp match /.../n against to UTF-8 string...

If you need to capture signatures on an IPad or similar device, you can use Thomas J Bradley's excellent...

So you're using multiple remotes that offer the same branch? $ git branch -a | grep my-branch remotes/something/my-branch remotes/origin/my-branch

You either have an old version of Mocha and an edge version of Rails 3.2, or you have a new...

makandra dev
github.com

Stringex is a gem that offers some extensions to Ruby's String class. Ruby 1.9 compatible, and knows its way...

When creating an ActiveRecord with .new, .create or create!, you cannot set the ID attribute (note: When using Machinist's...

You can use the content CSS attribute to set an element's content -- which is especially useful for the :before...

We recently had a problem on a Memcache cluster, where one of the servers showed a significantly worse cache hit...

josh.github.io

li.active a:link Example output (specificity): | 0 | 2 | 2 | See also: https://www.codecaptain.io/tools/css-specificity-calculator

makandra dev
github.com

Axlsx is an incredible gem to generate "Office Open XML" spreadsheet files (XLSX). Does not break on large spreadsheets and...

rspec.info

You can define methods in any example group using Ruby's def keyword or define_method method: describe "example" do...

TLDR: In tests you need to clean out the database before each example. Use :transaction where possible. Use :deletion for...

When you are using git rebase and are currently editing a commit (due to a conflict, for example), you may...

durdn.com

This article contains: Making ‘git diff’ wrap long lines Set a global proxy Clone only a specific branch

makandra dev

The bash offers control over the behavior of autocompletion. The most primitive example is this (just run it in your...

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

Static error pages To add a few basic styles to the default error pages in Rails, just edit the default...

If - for whatever reason - you have to render stylesheets dynamically, the following snippet might be of help. It emulates what...

Our old solution for cronjobs, the "craken" plugin, is no longer maintained and does not work on Rails 3.2+.

You know that you can force absolute URLs throughout a response. Now you want to modify URLs similarly, but only...