Download the dictionary from http://www.winedt.org/dict.html, e.g. http://www.winedt.org/dict/de_neu.zip unzip de_neu.zip mkdir ~/Documents/dic iconv -f UTF-16 -t...

RSpec allows defining methods inside describe/context blocks which will only exist inside them. However, classes (or any constants, for that...

There are several gems that make it easy to read and process xlsx files. Parsing the entire file at once...

docs.ruby-lang.org

Use return to return from a method. return accepts a value that will be the return value of the...

I frequently find myself needing a combination of group_by, count and sort for quick statistics. Here's a method...

makandra dev
sitepoint.com

Scope is all about where something is visible. It’s all about what (variables, constants, methods) is available to you...

You can use local copies of gems in your Gemfile like this: gem 'spreewald', path: '~/gems/spreewald' As soon as you...

makandra dev

In the ruby shell (IRB) and rails console the return value of the previous command is saved in _ (underscore). This...

I often see the use of || to set a default value for a variable that might be nil, null or...

ActiveRecord::RecordNotFound errors provide quite meaningful error messages that can provide some insight on application details. Consider the following:

This card will show you a cool way to define a class using Struct.new. A common usecase for Structs are...

Rails supports time zones, but there are several pitfalls. Most importantly because Time.now and Time.current are completely different things and...

makandra dev
stdgems.org

Ruby's standard library is in the process of being gemified. It will soon - Ruby 2.5 - consist of RubyGems, which...

Dump this method into your Ruby console to quickly print data in columns. This is helpful for e.g. comparing attributes...

In case you want to require a gem, that is not in the Gemfile of you bundle and therefore not...

makandra dev

This card compares patterns to store trees in a relation database like MySQL or PostgreSQL. Implementation examples are for the...

Sass lets you easily specify multiple selectors at once like this: .some-block &.has-hover, &:hover outline: 1px solid red...

github.com

Barby is a great Ruby gem to generate barcodes of all different sorts. It includes support for QR codes via...

makandra dev
activestate.com

Looks like ActiveState is trying to market a new Ruby distribution for Enterprises: ActiveRuby Enterprise Edition is designed for businesses...

There are various ways to run external commands from within Ruby, but the most powerful ones are Open3.capture3 and Open3.popen3...

stackoverflow.com

A collection of code snippets which return a boolean value for a regex comparison. regexp.match?(string) # Recommended for Ruby >= 2.4...

evilmartians.com

Adding a gem means you take over the liability towards the external code. Checklist Based on "To gem, or not...

Web technology is a broad field and you cannot be an expert in all aspects. However, it is useful to...