robots.thoughtbot.com

git command line options for automating common rebasing tasks, like adding a fix to a commit that was already rebased...

about.gitlab.com

When full text search is overkill and like queries do not deliver this might be an approach you could try...

support.mozilla.org

You cannot find your account passwords in the Account Settings – that'd be too easy. Here is where you find...

robots.thoughtbot.com

Declare an enum attribute where the values map to integers in the database, but can be queried by name.

ghacks.net

Firefox 3.6 users will receive update notifications in April offered through the browser’s internal updating service that will update...

superuser.com

Ubuntu natty introduced new "invisible" scrollbars for GTK programs such as gEdit or Nautilus. If you do not like them...

Ubuntu 24 added some guarding for Python packages which no longer allows installing applications through pip on system level. Instead...

...scopes live on the child model, so merge can compose them: class Subscription < ApplicationRecord belongs_to :account enum :status, { active: 'active', canceled: 'canceled', expired: 'expired' } scope :recently_canceled, -> { canceled.where(canceled...

...you combine results from a classical and a vector search engine gets you the best of both with the cost of twice the complexity. See An introduction to Hybrid search...

This card tries to summarize by example the different uses of heredoc. In Ruby << vs. <<- vs. <<~ In Rails strip_heredoc...

navy 0.5.1+ gives empty navigation containers a CSS class .navy-empty which you can hide via .navy-navigation &.navy-empty...

bundler.io

...version you want to use for each bundler command, e.g. bundler _2.1.4_ update New behavior Bundler now honors the version specified under BUNDLED_WITH in the Gemfile.lock. The necessary version...

gem update --system Updating the bundler version for a project With the new behavior bundler should never update its version in a Gemfile.lock automatically anymore. Therefore, unless there are...

The buffer where text is put into when you double-click on text within X is called X selection.

If you have jQuery code like this: if (condition) { $element.show(); } else { $element.hide(); } ... you can shorten this to: $element.toggle(condition);

Here are some hints on best practices to maintain your tasks in larger projects. Rake Tasks vs. Scripts The Rails default is using rake tasks for your application tasks. These...

run_script(subject, 42, 'some_arg') assert_something end end Further reading Best practices: Writing a Rails script (and how to test it...

tenderlovemaking.com

In Ruby, the meaning of protected and private is different from other languages like Java. (They don't hide methods...

makandra dev

...make block elements take up much more space than desired, even stretching their container beyond the screen edge on small screens. min-width is defined to win against competing width...

...is something like # WRONG class Page < ActiveRecord::Base %w[main sub].each do |type| belongs_to "#{type}_title" end end # RIGHT class Page < ActiveRecord::Base %w[main sub].each do...

belongs_to :"#{type}_title" end end Always convert to a symbol, otherwise you'll have all kinds of fun. Newer rails / activerecord (at least 5.2) will throw an association...

In a nutshell: Use git rebase --onto target-branch source-commit target-branch means "branch you want to be based...

A recent patch level Ruby update caused troubles to some of us as applications started to complain about incompatible gem...

Edit /etc/default/bind9 and change OPTIONS="-u bind" to OPTIONS="-u bind -d 50 -g" Restart BIND and you'll see...

I recently ran into this issue when processing a massive backlog of documents. The server completely stalled, sometimes taking up...

...pre-existing mocks inside the block, they are not reverted to the previously mocked behavior. This is usually not relevant and you should be fine in most cases...

makandra dev
tom.preston-werner.com

A perfect implementation of the wrong specification is worthless. By the same principle a beautifully crafted library with no documentation is also damn near worthless. If your software solves the...