PostgreSQL cheat sheet for MySQL lamers

Posted Over 10 years ago by Thomas Eisenbarth.

So you're switching to PostgreSQL from MySQL? Here is some help... General hints on PostgreSQL \? opens the command overview...

mysql2 and older ruby versions

Posted Over 10 years ago by Thomas Eisenbarth.

The mysql2 gem in version 0.3.13 might break while compiling on older patch releases of Ruby 1.9.3 within rvm:

dusen and edge_rider gems no longer depend on Rails

Posted Over 10 years ago by Henning Koch.

dusen 0.4.8 and edge_rider 0.2.3 no longer depend on Rails (they still depend on ActiveRecord). That means you can...

.rvmrc deprecated in favor of .ruby-version and .ruby-gemset

Posted Over 10 years ago by Thomas Eisenbarth.

Do not use .rvmrc files to specify Ruby version and gemset configuration any longer, it's deprecated and not considered...

"cannot load such file -- nokogiri/nokogiri" (or any other Gem with native extensions on rvm and Ruby >= 2)

Posted Over 10 years ago by Thomas Eisenbarth.

After running bundler / gem install I could not load nokogiri lately. It died with cannot load such file -- nokogiri/nokogiri.

Parallel gem installing using Bundler

Posted Over 10 years ago by Henning Koch.
robots.thoughtbot.com

Bundler 1.4.0 (still beta) can install gems in parallel, making a run of bundle install much faster.

The "private" modifier does not apply to class methods or define_method

Posted Over 10 years ago by Henning Koch.

Ruby's private keyword might do a lot less than you think. "private" does not apply to class methods defined...

RubyLTS

Posted Over 10 years ago by Henning Koch.
rubylts.com

RubyLTS is a long term supported fork of Ruby 1.8 that will continue to receive security updates for the forseeable...

exception_notification 4.0.0+ makes it easier to ignore errors, crawlers

Posted Almost 11 years ago by Henning Koch.
smartinez87.github.io

The new exception_notification has awesome options like :ignore_crawlers => true and :ignore_if => lambda {...

...}. These options should be helpful...

Consul 0.9 lets you optimize records checks

Posted Almost 11 years ago by Henning Koch.

Consul 0.9 comes with many new features to optimize powers that only check access to a given record. e.g. Power.current.post...

Cryptic Ruby Global Variables and Their Meanings

Posted Almost 11 years ago by Arne Hartherz.
jimneath.org

The linked page lists and explains global Ruby "dollar" variables, such as: $: (load path) $* (ARGV) $? (Last exit status) $$ (PID) $~ (MatchData...

Short lambda syntax in Ruby 1.9

Posted Almost 11 years ago by Henning Koch.

Ruby 1.9 brings a shorter way to define lambdas using the -> operator: twice = -> (x) { 2 * x } twice.call(5) # => 10

Live CSS / view reloading

Posted Almost 11 years ago by Tobias Kraze.

Next time you have to do more than trivial CSS changes on a project, you probably want to have live...

Batch-process text files with ruby

Posted Almost 11 years ago by Tobias Kraze.

Did you know you can do in-place batch processing with plain ruby? The following script will in-place replace...

Rails: Have different session secrets for all environments

Posted Almost 11 years ago by Dominik Schöler.

The Rails secret_token must be unique for each application and any instance of it. If not, someone could exploit...

Before you make a merge request: Checklist for common mistakes

Posted Almost 11 years ago by Tobias Kraze.

Merge requests are often rejected for similar reasons. To avoid this, before you send a merge request, please confirm that...

Virtus: Coercing boolean attributes

Posted Almost 11 years ago by Henning Koch.

Do it like this: attribute :active, Virtus::Attribute::Boolean Long story In Virtus you define attribute with their type...

marcandre/backports · GitHub

Posted Almost 11 years ago by Henning Koch.
github.com

Essential backports that enable many of the nice features of Ruby 1.8.7 up to 2.0.0 for earlier versions.

Subscribe to Rails security mailing list without Google account

Posted Almost 11 years ago by Thomas Eisenbarth.

The Ruby on Rails security list archive can be found here: http://groups.google.com/group/rubyonrails-security You can subscribe to this mailing...

Ruby Scripts: Select the Ruby version in the shebang

Posted Almost 11 years ago by Dominik Schöler.
robotlibrarian.billdueber.com

As Bill Dueber has on his blog, you can call rvm in the shebang to select a Ruby version like...

Tell RVM which patch level you mean by "1.8.7" or "1.9.3"

Posted About 11 years ago by Henning Koch.

When you download or upgrade RVM it has a hardcoded notion which patch level it considers to be "1.9.3".

How to discard a surrounding Bundler environment

Posted About 11 years ago by Arne Hartherz.

tl;dr: Ruby's Bundler environment is passed on to system calls, which may not be what you may want...

Ruby: What extend and include do

Posted About 11 years ago by Dominik Schöler.
aaronlasseigne.com

All Rubyists should be familiar with the common definitions for include and extend. You include a module to add instance...

YAML syntax compared with Ruby syntax

Posted About 11 years ago by Dominik Schöler.
nt.ntnu.no

yaml4r is a juxtaposition of yaml documents and their Ruby couterpart. Thus, it does a great job as YAML-doc...