Note: This applies to plain Ruby scripts, Rails does not have this issue. When you work with Ruby strings, those...

makandra dev
dev.mensfeld.pl

Ruby 2.3.0 has been around since end of 2015. It brings some pretty nice new features! Make sure to read...

You can download .gem files using gem fetch: gem fetch activesupport consul This will produce files like active-support-5.0.0.gem and consul-0.12.1.gem...

mitrev.net

As announced before, Ruby has introduced a safe navigation operator with version 2.3.0. receiver&.method prevents NoMethodErrors by intercepting method...

blog.blockscore.com

#dig lets you easily traverse nested hashes, arrays, or even a mix of them. It returns nil if any intermediate...

When testing Ruby code that prints something to the terminal, you can test that output. Since RSpec 3.0 there is...

PostgreSQL uses the C library's locale facilities for sorting strings: First, all the letters are compared, ignoring spaces and...

Converting string characters to or from their integer value (7-bit ASCII value or UTF-8 codepoint) can be done...

As your Rails project grows, you will accumulate a number of small patches. These will usually fix a bug in...

blog.skylight.io

Helix allows you to implement performance-critical code of your Ruby app in Rust, without requiring glue code to bridge...

When dealing with time zones in Rails, there is one key fact to keep in mind: Rails has configurable time...

Instead of using this hack you might want to use MariaDB 10.x which can work with both old and...

puppet.com

Don't use exec without user parameter If you use exec without user parameter, the command will get executed as...

github.com

Stackprof is a sampling call-stack profile for Ruby 2.1+. Instead of tracking all method calls, it will simply collect...

github.com

Uses FFI and works all relevant operating systems. If you'd try to do it yourself, you'd have to...

techblog.netflix.com

You login to a Linux server with a performance issue: what do you check in the first minute? uptime

nateberkopec.com

rack-mini-profiler is a powerful Swiss army knife for Rack app performance. Measure SQL queries, memory allocation and CPU...

In Ruby 2.3 you can use <<~ instead of <<- to automatically remove indentation from a HEREDOCs: str = <<~MESSAGE Hello Universe!

The nokogiri gem provides different packages for several platforms. Each platform-specific variant ships pre-built binaries of libxml2, e.g...

E-mails are usually encoded using Quoted Printable. Here is how to decode or encode such strings. You probably know...

This looks like it is safe to use: 2.2.1 :001 > a = b = "hello world" "hello world" 2.2.1 :002 > a

I recommend to go straight to 2.1.5+ without intermediate steps. Otherwhise you burden yourself with unnecessary work of encoding problems...

Ruby has the class Proc which encapsulates a "block of code". There are 2 "flavors" of Procs: Those with "block...

ruby-doc.org

This class contains nerdcore things such as disassembling a piece of Ruby into VM calls or enabling tail-call optimization...