Ruby: How to update all values of a Hash

Posted Over 8 years ago by Dominik Schöler.
stackoverflow.com

There are many solutions, but a very concise one is this: hash.merge!(hash) do |key, old_value, new_value|

How to split up a git commit

Posted Over 8 years ago by Dominik Schöler.
stackoverflow.com

git rebase -i -> mark your commit with edit git reset HEAD~ (remove the marked commit, but keep its...

PostgreSQL: Expanded display and other command line features

Posted Over 8 years ago by Andreas Robecke.
phili.pe

One useful postgres command I stumbled upon recently was \x. It gives you an expanded display which allows you to...

How to remove properties of ActiveRecord scopes

Posted Over 8 years ago by Arne Hartherz.

When dealing with AR scopes, you can remove conditions, order, etc by using the unscope method. It is available on...

A case for Redactor

Posted Over 8 years ago by Dominik Schöler.

Redactor is yet another WYSIWYG editor. It definitely has its weak points, but I want to point out that it...

PostgreSQL: How to add/remove/modify array values (and how to replace 1 value with multiple values)

Posted Over 8 years ago by Arne Hartherz.
postgresql.org

PostgreSQL's array data type is pretty useful, but manipulating values of arrays can be awkward because of its syntax...

How to disable Rails raising errors on pending migrations in development

Posted Over 8 years ago by Dominik Schöler.

Rails 4 introduced raising an error on pending migrations. This is most annoying when you are crafting a migration but...

Web Fonts Performance // Speaker Deck

Posted Over 8 years ago by Henning Koch.
speakerdeck.com

Web fonts are great. They are also be really bad for front-end performance because they block rendering. You may...

Keeping web applications fast

Posted Over 8 years ago by Tobias Kraze.

Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...

Recommended Git workflow for feature branches

Posted Over 8 years ago by Tobias Kraze.

This is a guide on how to effectively use Git when working on a feature branch. It is designed to...

OR-ing query conditions on Rails 4 and 3.2

Posted Over 8 years ago by Arne Hartherz.
github.com

Rails 5 will introduce ActiveRecord::Relation#or. On Rails 4 and 3.2 you can use the activerecord_any_of gem...

pgAdmin has a "graphical EXPLAIN" feature

Posted Over 8 years ago by Arne Hartherz.
postgresonline.com

When working with PostgreSQL, you can use pgAdmin as a GUI. While you can do most things just like on...

Escape a string for transportation in a URL

Posted Over 8 years ago by Henning Koch.

To safely transport an arbitrary string within a URL, you need to percent-encode characters that have a particular meaning...

Improving browser rendering performance

Posted Over 8 years ago by Dominik Schöler.

As the web is being used for more and more tasks, expectations rise. Not only should web pages offer rich...

Project management best practices: Stories

Posted Over 8 years ago by Tobias Kraze.

We organize our daily work with stories in Pivotal Tracker. Story format A good story needs to be precise. It...

Pitfall: has_defaults on virtual attributes are nil when loaded from database, of course …

Posted Over 8 years ago.

It smells. Rethink your code design. Code example with makandra/has_defaults: class Post < ActiveRecord::Base has_defaults tags: [] # field in db...

Flash-Free Clipboard for the Web

Posted Over 8 years ago by Henning Koch.
hacks.mozilla.org

Unfortunately, Web APIs haven’t provided the functionality to copy text to the clipboard through JavaScript, which is why visiting...

An auto-mapper for ARIA labels and BEM classes in Cucumber selectors

Posted Over 8 years ago by Henning Koch.

Spreewald comes with a selector_for helper that matches an English term like the user's profile into a CSS...

AWS Public IP Address Ranges Now Available in JSON Form

Posted Over 8 years ago by Henning Koch.
aws.amazon.com

I am happy to announce that this information is now available in JSON form at https://ip-ranges.amazonaws.com/ip-ranges.json. The information...

postgresql create extension without giving the application superuser rights

Posted Over 8 years ago by Kim Klotz.

If you need a postgresql extension for your database it isn't a good idea to give your applications database...

ActiveRecord: scoped `validates_uniqueness_of` allows one null value per scope

Posted Over 8 years ago.

As you most likely know validates_uniqness_of :foreign_id does not allow nil values by default.

How to deal with 'parent id missing' error in nested forms

Posted Over 8 years ago.

Use form models to handle this problem Or soften the validation to validates_presence_of :parent

How to enable SSL in development with Passenger standalone

Posted Over 8 years ago by Arne Hartherz.

Here is how to start your Rails application to accept both HTTP and HTTPS in development. gem install passenger

Getting Sidekiq error "delay is defined by Active Record"

Posted Over 8 years ago by Thomas Eisenbarth.

Reason: You very likely have a model that has a delay attribute. You can configure Sidekiq to remove its delay...