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

When using GROUP BY, MySQL now complains if the SELECT includes columns which are not part of the GROUP BY...

Since Rails 5, domain models inherit from ApplicationRecord by default. This is the place to put code that should be...

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

Ubuntu might create several keyrings for you. Note that keyring passwords are initially set to the user password but do...

stackoverflow.com

This card will show you how to use git rebase --onto without confusion. Use case: You've got two feature...

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...

Middleman is a static page generator that brings many of the goodies that Rails developers are used to.

Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread.

makandra dev

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

github.com

The parallel-gem is quite easy to use and can speed up rendering time if you want to render the...

blog.jetbrains.com

RubyMine allows bookmarking lines of code. This is super-helpful when working on a complex problem. I've been using...

For the initial setup or changes in the sentry reporting it might be useful to enabled reporting of sentry in...

makandra dev

You can start vim with a read-only option. This prevents making accidentally changes in files you don't want...

Note: The behaviour of Spreewald's within step is as described below for version < 1.9.0; For Spreewald >= 1.9.0 it is...

github.com

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

This card is just about creating simple PostgreSQL dumps. This is no instruction for a backup strategy nor a guide...

Hint This applies only to distributions based on Debian. Requirement You need to setup the PostgreSQL Apt Repository first.

makandra dev

This is a visualization of the files that will be generated by some useful rails generators. Invoke a generator from...

makandra Operations

on the bash (issued as postgres user) Start/Stop/Restart PostgreSQL pg_ctl -D $configdir start|stop|restart Start/Stop/Restart the corresponding PostgreSQL...

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

makandra dev

Sometimes your code has long lines: describe 'foo' do describe 'bar' do really_long_line_really_long_line_really_long...

stackoverflow.com

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

There seems to be a nasty bug in Chrome 56 when testing with Selenium and Capybara: Slashes are not written...